经过一天左右的故障排除,我解决了这个问题。我有一个文件run.py,它实际上启动了应用程序,但buildozer自动运行main.py,在我的情况下,它只导入其他文件。我只需要把run.py的内容移到main.py上,这个应用程序运行得很好。
我已经尝试用Buildozer编译用Python和Kivy开发的应用程序几个小时了。我可以让一个应用程序部署到我的android上,但它总是会在启动时崩溃。通常我只会在日志中找到问题(通常是规范文件中缺少相关性(,但这次日志似乎什么都没有显示。我会提供它们,以防我错过了什么。我认为唯一可能出现问题的是旧的配置警告,但我不确定具体如何解决。
03-19 00:43:27.708 27973 28277 I python : Initializing Python for Android
03-19 00:43:27.708 27973 28277 I python : Setting additional env vars from p4a_env_vars.txt
03-19 00:43:27.708 27973 28277 I python : Changing directory to the one provided by ANDROID_ARGUMENT
03-19 00:43:27.708 27973 28277 I python : /data/user/0/org.main.v4.uhs.signoff/files/app
03-19 00:43:27.708 27973 28277 I python : Preparing to initialize python
03-19 00:43:27.708 27973 28277 I python : _python_bundle dir exists
03-19 00:43:27.708 27973 28277 I python : calculated paths to be...
03-19 00:43:27.708 27973 28277 I python : /data/user/0/org.main.v4.uhs.signoff/files/app/_python_bundle/stdlib.zip:/data/user/0/org.main.v4.uhs.signoff/files/app/_python_bundle/modules
03-19 00:43:27.708 27973 28277 I python : set wchar paths...
03-19 00:43:27.737 27973 28277 I python : Initialized python
03-19 00:43:27.738 27973 28277 I python : AND: Init threads
03-19 00:43:27.738 27973 28277 I python : testing python print redirection
03-19 00:43:27.738 27973 28277 I python : Android path ['.', '/data/user/0/org.main.v4.uhs.signoff/files/app/_python_bundle/stdlib.zip', '/data/user/0/org.main.v4.uhs.signoff/files/app/_python_bundle/modules', '/data/user/0/org.main.v4.uhs.signoff/files/app/_python_bundle/site-packages']
03-19 00:43:27.738 27973 28277 I python : os.environ is environ({'PATH': '/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin', 'ANDROID_BOOTLOGO': '1', 'ANDROID_ROOT': '/system', 'ANDROID_ASSETS': '/system/app', 'ANDROID_DATA': '/data', 'ANDROID_STORAGE': '/storage', 'ANDROID_ART_ROOT': '/apex/com.android.art', 'ANDROID_I18N_ROOT': '/apex/com.android.i18n', 'ANDROID_TZDATA_ROOT': '/apex/com.android.tzdata', 'EXTERNAL_STORAGE': '/sdcard', 'ASEC_MOUNTPOINT': '/mnt/asec', 'DOWNLOAD_CACHE': '/data/cache', 'BOOTCLASSPATH': '/apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/knoxsdk.jar:/system/framework/knoxanalyticssdk.jar:/system/framework/drutils.jar:/system/framework/uibc_java.jar:/system/framework/SmpsManager.jar:/system/framework/esecomm.jar:/system/framework/tcmiface.jar:/system/framework/telephony-ext.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/sem-telephony-common.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.wifi/javalib/framework-wifi.jar:/apex/com.samsung.android.ipm/javalib/framework-samsung-ipm.jar:/apex/com.samsung.android.shell/javalib/framework-samsung-privilege.jar', 'DEX2OATBOOTCLASSPATH': '/apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/knoxsdk.jar:/system/framework/knoxanalyticssdk.jar:/system/framework/drutils.jar:/system/framework/uibc_java.jar:/system/framework/SmpsManager.jar:/system/framework/esecomm.jar:/system/framework/tcmiface.jar:/system/framework/telephony-ext.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/sem-telephony-common.jar:/apex/com.android.i18n/javalib/core-icu4j.jar', 'SYSTEMSERVERCLASSPATH': '/system/framework/com.android.location.provider.jar:/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/ssrm.jar:/system/framework/semwifi-service.jar:/apex/com.android.appsearch/javalib/service-appsearch.jar:/apex/com.android.media/javalib/service-media-s.jar:/apex/com.android.permission/javalib/service-permission.jar:/apex/com.samsung.android.ipm/javalib/service-samsung-ipm.jar:/apex/com.samsung.android.shell/javalib/service-samsung-privilege.jar', 'KNOX_STORAGE': '/data/knox/ext_sdcard', 'ENC_EMULATED_STORAGE_TARGET': '/storage/enc_emulated', 'ANDROID_SOCKET_zygote': '18', 'ANDROID_SOCKET_usap_pool_primary': '22', 'ANDROID_ENTRYPOINT': 'main.pyc', 'ANDROID_ARGUMENT': '/data/user/0/org.main.v4.uhs.signoff/files/app', 'ANDROID_APP_PATH': '/data/user/0/org.main.v4.uhs.signoff/files/
03-19 00:43:27.739 27973 28277 I python : Android kivy bootstrap done. __name__ is __main__
03-19 00:43:27.739 27973 28277 I python : AND: Ran string
03-19 00:43:27.739 27973 28277 I python : Run user program, change dir and execute entrypoint
03-19 00:43:27.806 27973 28277 I python : [WARNING] [Config ] Older configuration version detected (0 instead of 24)
03-19 00:43:27.806 27973 28277 I python : [WARNING] [Config ] Upgrading configuration in progress.
03-19 00:43:27.809 27973 28277 I python : [INFO ] [Logger ] Record log in /data/user/0/org.main.v4.uhs.signoff/files/app/.kivy/logs/kivy_22-03-19_0.txt
03-19 00:43:27.809 27973 28277 I python : [INFO ] [Kivy ] v2.1.0
03-19 00:43:27.809 27973 28277 I python : [INFO ] [Kivy ] Installed at "/data/user/0/org.main.v4.uhs.signoff/files/app/_python_bundle/site-packages/kivy/__init__.pyc"
03-19 00:43:27.809 27973 28277 I python : [INFO ] [Python ] v3.8.9 (default, Mar 19 2022, 00:23:40)
03-19 00:43:27.809 27973 28277 I python : [Clang 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec7462
03-19 00:43:27.809 27973 28277 I python : [INFO ] [Python ] Interpreter at ""
03-19 00:43:27.810 27973 28277 I python : [INFO ] [Logger ] Purge log fired. Processing...
03-19 00:43:27.810 27973 28277 I python : [INFO ] [Logger ] Purge finished!
03-19 00:43:28.286 27973 28277 I python : [INFO ] [Factory ] 189 symbols loaded
03-19 00:43:28.424 27973 28277 I python : [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2 (img_pil, img_ffpyplayer ignored)
03-19 00:43:28.439 27973 28277 I python : [INFO ] [Text ] Provider: sdl2
03-19 00:43:28.456 27973 28277 I python : [INFO ] [Window ] Provider: sdl2
03-19 00:43:28.516 27973 28277 I python : [INFO ] [GL ] Using the "OpenGL ES 2" graphics system
03-19 00:43:28.517 27973 28277 I python : [INFO ] [GL ] Backend used <sdl2>
03-19 00:43:28.517 27973 28277 I python : [INFO ] [GL ] OpenGL version <b'OpenGL ES 3.2 V@0502.0 (GIT@3dad7f8ed7, I593c16c433, 1633080534) (Date:10/01/21)'>
03-19 00:43:28.517 27973 28277 I python : [INFO ] [GL ] OpenGL vendor <b'Qualcomm'>
03-19 00:43:28.517 27973 28277 I python : [INFO ] [GL ] OpenGL renderer <b'Adreno (TM) 640'>
03-19 00:43:28.518 27973 28277 I python : [INFO ] [GL ] OpenGL parsed version: 3, 2
03-19 00:43:28.518 27973 28277 I python : [INFO ] [GL ] Texture max size <16384>
03-19 00:43:28.518 27973 28277 I python : [INFO ] [GL ] Texture max units <16>
03-19 00:43:28.543 27973 28277 I python : [INFO ] [Window ] auto add sdl2 input provider
03-19 00:43:28.544 27973 28277 I python : [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
03-19 00:43:28.583 27973 28277 I python : Python for android ended.
我正在将此应用程序部署到三星Galaxy S10+,并且我正在使用此adb过滤器:*:S Python:D
我是不是做错了什么?或者这可能是应用程序本身的问题,我该如何进行实际跟踪?谢谢你的帮助!