在我的Android手机上编译和部署我的kivy应用程序后,我在盯着应用程序时遇到此错误(它包括一个osc服务)。可能是什么原因?
02-03 11:10:59.839 21140 21172 I python : [INFO ] [Logger ] Record log in /data/user/0/com.keinert.stayalive/files/app/.kivy/logs/kivy_19-02-03_1.txt
02-03 11:10:59.839 21140 21172 I python : [INFO ] [Kivy ] v1.11.0.dev0, git-Unknown, 20190203
02-03 11:10:59.840 21140 21172 I python : [INFO ] [Python ] v3.7.1 (default, Feb 3 2019, 09:58:20)
02-03 11:10:59.840 21140 21172 I python : [Clang 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55
02-03 11:10:59.932 21140 21172 I python : [INFO ] [Factory ] 184 symbols loaded
02-03 11:11:00.428 21140 21172 I python : [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
02-03 11:11:00.544 21140 21172 I python : [INFO ] [Text ] Provider: sdl2
02-03 11:11:00.581 21140 21172 I python : Traceback (most recent call last):
02-03 11:11:00.581 21140 21172 I python : File "/home/joachim/PycharmProjects/StayAlive/.buildozer/android/app/main.py", line 11, in <module>
02-03 11:11:00.583 21140 21172 I python : ImportError: cannot import name 'osc' from 'kivy.lib' (/data/user/0/com.keinert.stayalive/files/app/_python_bundle/site-packages/kivy/lib/__init__.pyc)
02-03 11:11:00.583 21140 21172 I python : Python for android ended.
我不知道为什么它让我用buildozer构建apk但是在android上运行它失败了。
构建列出了oscpy:
[INFO]: Of the existing distributions, the following meet the given requirements:
[INFO]: stayalive: min API 21, includes recipes (hostpython3, sdl2_image, sdl2_mixer, sdl2_ttf, python3, sdl2, six, pyjnius, kivy, oscpy, cython), built for archs (armeabi-v7a)
[INFO]: stayalive has compatible recipes, using this one
以下是有关代码级别的信息:sdk 24 ndk 17c Android API目标26 NDK修订版17.2.4988734 Buildozer 0.38.dev0(因为这个suggestion使用)
你的问题的解决方案是首先添加你的buildozer.spec
oscpy作为依赖,你发现它前往tshirtman的项目oscpy(https://github.com/kivy/oscpy),阅读新的API,并实现它并准备问候。