Python, Kivy, Buildozer: APK crashes with SymPy

大城市里の小女人 提交于 2021-02-10 15:42:08

问题


As the title says, I've made an .apk to run on my Android mobile. It runs perfectly on PC. As soon as I take out all SymPy commands, it runs on Android too. I've mentioned the "sympy" in the buildozer.spec file, and it's not giving any errors. But as soon, as the loading on my Android-screen is over, the App disappears.

Does anyone know, if I have to do more, than mentioning the sympy in the .specs file?

ADB-Logcat: "ImportError: No module named unittest"

I don't know, what "unittest" ist, and why it's trying to get imported.

Solved: I found unittest.py (google: "inurl:unittest.py") and saved it inside the project folder.


回答1:


I know this is an old topic, but I think it can still help.

This is because the unittest module is blacklisted, see blacklist.txt file in the .buildozer/ directory.

grep unittest .buildozer/android/platform/build/dists/*/blacklist.txt

So you can whitelist it by updating your buildozer.spec:

# (list) Pattern to whitelist for the whole project
android.whitelist = unittest/*


来源:https://stackoverflow.com/questions/31080615/python-kivy-buildozer-apk-crashes-with-sympy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!