kivy / buildozer

Generic Python packager for Android and iOS
https://buildozer.readthedocs.io
MIT License
1.74k stars 502 forks source link

APK Crashes on start with no obvious cause #779

Closed afewlines closed 5 years ago

afewlines commented 5 years ago

Description

If I didn't include anything I should have, please let me know. First issue and I'm not sure if I if under- or over-shared. Repository: https://github.com/afewlines/buildozer-keytar

So the issue is odd: the app runs fine and dandy on local. Compiles, installs on target device as well. On device, crashes immediately after presplash. No errors are thrown regarding it via logcat as far as I can tell, only bit directly relevant to the app is (mostly full logcat in above repo)

01-06 03:17:06.707 19092 19092 W linker  : Warning: "/data/app/org.seeker.keytar-RnuMonJcVkkBJdOOz-RwEA==/lib/arm/libpython2.7.so" has no DT_SONAME (will use libpython2.7.so instead) and will not work when the app moves to API level 23 or later (https://android.googlesource.com/platform/bionic/+/master/missing-soname-enforced-for-api-level-23) (allowing for now because this app's target API level is still 19)
01-06 03:17:06.708 19092 19092 V pythonutil: Loading library: python3.5m
01-06 03:17:06.709 19092 19092 V pythonutil: Library loading error: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/org.seeker.keytar-RnuMonJcVkkBJdOOz-RwEA==/base.apk"],nativeLibraryDirectories=[/data/app/org.seeker.keytar-RnuMonJcVkkBJdOOz-RwEA==/lib/arm, /system/fake-libs, /data/app/org.seeker.keytar-RnuMonJcVkkBJdOOz-RwEA==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libpython3.5m.so"
01-06 03:17:06.709 19092 19092 V pythonutil: Loading library: main
01-06 03:17:06.710 19092 19092 W linker  : Warning: "/data/data/org.seeker.keytar/files/app/lib/python2.7/lib-dynload/_io.so" has no DT_SONAME (will use _io.so instead) and will not work when the app moves to API level 23 or later (https://android.googlesource.com/platform/bionic/+/master/missing-soname-enforced-for-api-level-23) (allowing for now because this app's target API level is still 19)
01-06 03:17:06.711 19092 19092 W linker  : Warning: "/data/data/org.seeker.keytar/files/app/lib/python2.7/lib-dynload/unicodedata.so" has no DT_SONAME (will use unicodedata.so instead) and will not work when the app moves to API level 23 or later (https://android.googlesource.com/platform/bionic/+/master/missing-soname-enforced-for-api-level-23) (allowing for now because this app's target API level is still 19)
01-06 03:17:06.711 19092 19092 W linker  : Warning: "/data/data/org.seeker.keytar/files/app/lib/python2.7/lib-dynload/_ctypes.so" has no DT_SONAME (will use _ctypes.so instead) and will not work when the app moves to API level 23 or later (https://android.googlesource.com/platform/bionic/+/master/missing-soname-enforced-for-api-level-23) (allowing for now because this app's target API level is still 19)
01-06 03:17:06.712 19092 19092 V pythonutil: Loaded everything!
01-06 03:17:06.722 19092 19092 V PythonActivity: Setting env vars for start.c and Python to use
01-06 03:17:06.722 19092 19092 V PythonActivity: Access to our meta-data...
01-06 03:17:06.723 19092 19092 I PythonActivity: Surface will NOT be transparent
01-06 03:17:06.744 19092 19092 V SDL     : surfaceCreated()
01-06 03:17:06.744 19092 19092 V SDL     : surfaceChanged()
01-06 03:17:06.744 19092 19092 V SDL     : pixel format RGB_565
01-06 03:17:06.745 19092 19092 V SDL     : Window size:1080x2200
01-06 03:17:06.746 19092 19092 E SensorManager: registerListenerImpl sensorName:BMI160_ACCELEROMETER Accelerometer Non-wakeup,isWakeUpSensor:false,callingApp: org.seeker.keytar,callingPid:19092,callingUid:10204
01-06 03:17:06.746   706   706 I sensors-hal: batch:129, android.sensor.accelerometer/47, period=20000000, max_latency=0
01-06 03:17:06.746   706   706 I sensors-hal: batch:138, android.sensor.accelerometer/47, period=20000000, max_latency=0 request completed
01-06 03:17:06.747   706   706 I sensors-hal: activate:96, android.sensor.accelerometer/47 en=1
01-06 03:17:06.751   706   706 I sensors-hal: activate:107, android.sensor.accelerometer/47 en=1 completed
01-06 03:17:06.752 19092 19128 I SDL     : SDL_Android_Init()
01-06 03:17:06.752 19092 19128 I SDL     : SDL_Android_Init() finished!
01-06 03:17:06.752 19092 19128 I python  : Initialize Python for Android
01-06 03:17:06.752 19092 19128 I python  : Changing directory to the one provided by ANDROID_ARGUMENT
01-06 03:17:06.752 19092 19128 I python  : /data/user/0/org.seeker.keytar/files/app
01-06 03:17:06.752 19092 19128 I python  : Preparing to initialize python
01-06 03:17:06.752 19092 19128 I python  : crystax_python does not exist
01-06 03:17:06.755 19092 19128 I python  : Initialized python
01-06 03:17:06.755 19092 19128 I python  : AND: Init threads
01-06 03:17:06.755 19092 19128 I python  : testing python print redirection
01-06 03:17:06.755 19092 19128 I python  : Setting up python from ANDROID_PRIVATE
01-06 03:17:06.756 19092 19128 I python  : ('Android path', ['/data/user/0/org.seeker.keytar/files/app/lib/python27.zip', '/data/user/0/org.seeker.keytar/files/app/lib/python2.7/', '/data/user/0/org.seeker.keytar/files/app/lib/python2.7/lib-dynload/', '/data/user/0/org.seeker.keytar/files/app/lib/python2.7/site-packages/', '/data/user/0/org.seeker.keytar/files/app'])
01-06 03:17:06.763 19092 19128 I python  : ('os.environ is', {'DOWNLOAD_CACHE': '/data/cache', 'ANDROID_UNPACK': '/data/user/0/org.seeker.keytar/files/app', 'EXTERNAL_STORAGE': '/sdcard', 'ANDROID_ENTRYPOINT': 'main.pyo', 'ANDROID_ASSETS': '/system/app', 'PYTHONPATH': '/data/user/0/org.seeker.keytar/files/app:/data/user/0/org.seeker.keytar/files/app/lib', 'ANDROID_APP_PATH': '/data/user/0/org.seeker.keytar/files/app', 'ANDROID_ROOT': '/system', 'SYSTEMSERVERCLASSPATH': '/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar:/system/framework/com.android.location.provider.jar', 'PYTHONOPTIMIZE': '2', 'ANDROID_DATA': '/data', 'PYTHONHOME': '/data/user/0/org.seeker.keytar/files/app', 'ANDROID_ARGUMENT': '/data/user/0/org.seeker.keytar/files/app', 'BOOTCLASSPATH': '/system/framework/qtiNetworkLib.jar:/system/framework/com.qualcomm.qti.camera.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/bouncycastle.jar:/system/framework/apache-xml.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/android.hidl.base-V1.0-java.jar:/system/framework/android.hidl.manager-V1.0-java.jar:/system/framework/framework-oahl-backward-compatibility.jar:/system/framework/android.test.base.jar:/system/framework/oneplus_sdk_utils.jar:/system/framework/oneplus_sdk_wrapper.jar:/system/framework/com.nxp.nfc.jar:/system/framework/telephony-ext.jar:/system/framework/tcmiface.jar:/system/framework/WfdCommon.jar:/system/framework/wapicertstore.jar:/system/framework/com.qti.snapdragon.sdk.display.jar:/system/framework/qcnvitems.jar:/system/framework/qcrilhook.jar', 'ANDROID_SOCKET_zygote_secondary': '12', 'ASEC_MOUNTPOINT': '/mnt/asec', 'PATH': '/sbin:/system/sbin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin', 'ANDROID_STORAGE': '/storage', 'ANDROID_BOOTLOGO': '1', 'ANDROID_PRIVATE': '/data/user/0/org.seeker.keytar/files', 'PYTHON_NAME': 'python'})
01-06 03:17:06.763 19092 19128 I python  : ('Android kivy bootstrap done. __name__ is', '__main__')
01-06 03:17:06.773 19092 19128 I python  : ['/data/user/0/org.seeker.keytar/files/app/lib/python2.7/site-packages', '/data/user/0/org.seeker.keytar/files/app/lib/site-python']
01-06 03:17:06.773 19092 19128 I python  : AND: Ran string
01-06 03:17:06.773 19092 19128 I python  : Run user program, change dir and execute entrypoint
01-06 03:17:06.773 19092 19128 I python  : main.py
01-06 03:17:06.773 19092 19128 I python  : Entrypoint not found (.pyo, fallback on .py), abort
01-06 03:17:06.775  1169  1200 D ActivityTrigger: ActivityTrigger activityPauseTrigger
01-06 03:17:06.777 19092 19092 V PythonActivity: onPause()
01-06 03:17:06.777 19092 19092 V SDL     : onPause()
01-06 03:17:06.777 19092 19092 V SDL     : nativePause()
01-06 03:17:06.777 19092 19092 E SensorManager: unregisterListenerImpl sensorName:BMI160_ACCELEROMETER Accelerometer Non-wakeup,isWakeUpSensor:false,callingApp: org.seeker.keytar,callingPid:19092,callingUid:10204
01-06 03:17:06.778   706   706 I sensors-hal: activate:96, android.sensor.accelerometer/47 en=0
01-06 03:17:06.778   706   706 I sensors-hal: activate:107, android.sensor.accelerometer/47 en=0 completed
01-06 03:17:06.778  1169  1234 D RestartProcessManager: Duration is too short, ignore : 999 in org.seeker.keytar

All searches regarding things that seem remotely concerning (Entrypoint not found, Error loading library) were fruitless.

Any and all help is appreciated.

Command:

android -v debug deploy run logcat

.spec, full log in repo

inclement commented 5 years ago

01-06 03:17:06.773 19092 19128 I python : Entrypoint not found (.pyo, fallback on .py), abort

This error means that the app code couldn't find your file, which should be called main.py (and might become main.pyo on the device). It sounds like either that's not what your file was called, or it didn't get included in the apk for some reason.