arabic_reshaper在windows和linux上运行得很好,但是当我在android中以apk文件的形式运行它时,应用程序崩溃了。我的错误是:
python : Traceback (most recent call last):
python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/app/main.py", line 18, in <module>
python : File "/media/mehdi/2436ef15-26cf-4be8-9eed-6befb73eddd8/mehdi/Documents/BuildozerTest/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/FinalAPP/arabic_reshaper/__init__.py", line 12, in <module>
python : FileNotFoundError: [Errno 2] No such file or directory: '/data/user/0/org.test.finalapp/files/app/_python_bundle/site-packages/arabic_reshaper/__version__.py'
python : Python for android ended.在第18行,导入了arabic_reshaper
我该如何解决这个问题?
发布于 2020-12-07 07:51:00
您是否将该模块作为一个要求包括在内?如果您已经这样做了,那么模块可能已经编译了组件,并且需要一个配方。检查here
如果你使用的是buildozer,也可以试试buildozer android clean。
另一种不推荐使用的解决方法是将模块包含在与main.py相同的目录中。
发布于 2020-12-08 05:20:27
是的,我在*.spec上添加了阿拉伯重整器,并且我使用了buildozer。谢谢,我读过“菜谱”,但我是初学者,所以不太懂。我已经写了简单的代码,现在我不知道该把这个文件的名字放在哪里?
from pythonforandroid.recipe import PythonRecipe
class ArabicReshaperRecipe(PythonRecipe):
url = 'https://github.com/mpcabd/python-arabic-reshaper/archive/master.zip'
depends = ['python3', 'numpy','sys','unittest']
site_packages_name = 'arabic_reshaper'
recipe = ArabicReshaperRecipe()https://stackoverflow.com/questions/65170398
复制相似问题