如何在logcat中查找错误?
使用编辑器搜索“I python”或buildozer android debug deploy run > grep "I python"
Logcat3.txt - 错误
08-11 17:05:10.323 7746 7801 I python : [INFO ] [Logger ] Record log in /data/user/0/org.test.digitable/files/app/.kivy/logs/kivy_19-08-11_0.txt
08-11 17:05:10.323 7746 7801 I python : [INFO ] [Kivy ] v1.11.0
08-11 17:05:10.323 7746 7801 I python : [INFO ] [Kivy ] Installed at "/data/user/0/org.test.digitable/files/app/_python_bundle/site-packages/kivy/__init__.pyo"
08-11 17:05:10.323 7746 7801 I python : [INFO ] [Python ] v2.7.15 (default, Aug 11 2019, 16:47:41)
08-11 17:05:10.323 7746 7801 I python : [GCC 4.2.1 Compatible Android (4691093 based on r316199) Clang 6.0.2 (https://a
08-11 17:05:10.323 7746 7801 I python : [INFO ] [Python ] Interpreter at ""
08-11 17:05:10.324 7746 7801 I python : [WARNING] [Deprecated ] Python 2 Kivy support has been deprecated. The Kivy release after 1.11.0 will not support Python 2 anymore
08-11 17:05:10.781 7746 7801 I python : [INFO ] [Factory ] 184 symbols loaded
08-11 17:05:11.027 7746 7801 I python : [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
08-11 17:05:11.063 7746 7801 I python : [INFO ] [Window ] Provider: sdl2
08-11 17:05:11.217 7746 7801 I python : [INFO ] [GL ] Using the "OpenGL ES 2" graphics system
08-11 17:05:11.218 7746 7801 I python : [INFO ] [GL ] Backend used <sdl2>
08-11 17:05:11.219 7746 7801 I python : [INFO ] [GL ] OpenGL version <OpenGL ES 3.2 v1.r14p0-00cet0.0416641283c5d6e2d53c163d0ca99357>
08-11 17:05:11.219 7746 7801 I python : [INFO ] [GL ] OpenGL vendor <ARM>
08-11 17:05:11.219 7746 7801 I python : [INFO ] [GL ] OpenGL renderer <Mali-G72>
08-11 17:05:11.219 7746 7801 I python : [INFO ] [GL ] OpenGL parsed version: 3, 2
08-11 17:05:11.220 7746 7801 I python : [INFO ] [GL ] Texture max size <8192>
08-11 17:05:11.220 7746 7801 I python : [INFO ] [GL ] Texture max units <16>
08-11 17:05:11.268 7746 7801 I python : [INFO ] [Window ] auto add sdl2 input provider
08-11 17:05:11.269 7746 7801 I python : [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
08-11 17:05:11.272 7746 7801 I python : Traceback (most recent call last):
08-11 17:05:11.272 7746 7801 I python : File "/home/laurent/Downloads/Files4apk/.buildozer/android/app/main.py", line 15, in <module>
08-11 17:05:11.273 7746 7801 I python : File "/home/laurent/Downloads/Files4apk/.buildozer/android/platform/build/build/python-installs/digitable/pandas/__init__.py", line 19, in <module>
08-11 17:05:11.273 7746 7801 I python : ImportError: Missing required dependencies ['numpy', 'pytz', 'dateutil']
08-11 17:05:11.273 7746 7801 I python : Python for android ended.
问题
您的 buildozer.spec 缺少依赖项 ['numpy', 'pytz', 'dateutil']
解决方案
将依赖项 ['numpy', 'pytz', 'dateutil'] 添加到 buildozer.spec 中的需求
requirements = python2,kivy,pandas,numpy,pytz,dateutil
Logcat1.txt - 错误
08-11 09:19:50.492 10715 10755 I python : [INFO ] [Logger ] Record log in /data/user/0/org.test.digitable/files/app/.kivy/logs/kivy_19-08-11_1.txt
08-11 09:19:50.492 10715 10755 I python : [INFO ] [Kivy ] v1.11.0
08-11 09:19:50.493 10715 10755 I python : [INFO ] [Kivy ] Installed at "/data/user/0/org.test.digitable/files/app/_python_bundle/site-packages/kivy/__init__.pyo"
08-11 09:19:50.493 10715 10755 I python : [INFO ] [Python ] v2.7.15 (default, Aug 10 2019, 22:32:55)
08-11 09:19:50.493 10715 10755 I python : [GCC 4.2.1 Compatible Android (4691093 based on r316199) Clang 6.0.2 (https://a
08-11 09:19:50.493 10715 10755 I python : [INFO ] [Python ] Interpreter at ""
08-11 09:19:50.494 10715 10755 I python : [WARNING] [Deprecated ] Python 2 Kivy support has been deprecated. The Kivy release after 1.11.0 will not support Python 2 anymore
08-11 09:19:50.495 10715 10755 I python : Traceback (most recent call last):
08-11 09:19:50.495 10715 10755 I python : File "/home/laurent/Downloads/Files4apk/.buildozer/android/app/main.py", line 2, in <module>
08-11 09:19:50.495 10715 10755 I python : File "/home/laurent/Downloads/Files4apk/.buildozer/android/platform/build/build/python-installs/digitable/kivy/__init__.py", line 139, in require
08-11 09:19:50.496 10715 10755 I python : Exception: The version of Kivy installed on this system is too old. (You have 1.11.0, but the application requires 1.11.1)
08-11 09:19:50.496 10715 10755 I python : Python for android ended.
问题
- 在您的 buildozer.spec 中,您指定了 Kivy 版本 1.11.1 和 Python 2,但在您的
Kivy 应用,(main.py),它有 1.11.0
- Python 2 Kivy 支持已被弃用。 1.11.0 之后的 Kivy 版本将不再支持 Python 2
解决方案
- 要么删除 main.py 中的以下内容,要么将其更改为
'1.11.1'(即与 buildozer.spec 相同)
import kivy
kivy.require('1.11.0')
- 如果你想使用 Kivy 版本 1.11.1,你必须将
python2 替换为 python3 为 requirements