0

我的背景是 HTML/JS,所以编译对我来说是新的。尝试在 Kivy 中将我的 python 项目构建为 Android .apk 时,我收到一个我不明白的错误:

Command failed: ./distribute.sh -m "kivy"

这是调试输出尾部的一部分...

Compiling /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/xmllib.py ...
Compiling /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/xmlrpclib.py ...
Compiling /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/zipfile.py ...
make: [libinstall] Error 1 (ignored)
PYTHONPATH=/Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7  LD_LIBRARY_PATH=/Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python/Python-2.7.2: \
        /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python/Python-2.7.2/hostpython -Wi -t /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/compileall.py \
        -d /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages -f \
        -x badsyntax /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages
Listing /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages ...
PYTHONPATH=/Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7 LD_LIBRARY_PATH=/Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python/Python-2.7.2: \
        /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python/Python-2.7.2/hostpython -Wi -t -O /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/compileall.py \
        -d /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages -f \
        -x badsyntax /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages
Listing /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages ...
PYTHONPATH=/Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7 LD_LIBRARY_PATH=/Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python/Python-2.7.2: \
        /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python/Python-2.7.2/hostpython -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
Leaving ARM environment
cp: build/lib.linux-x86_64-2.7/_ctypes*.so: No such file or directory
# Command failed: ./distribute.sh -m "kivy" -d "myapp"
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

这是完整的调试,对于那些想要它的人......

https://www.dropbox.com/s/45lgdhk5y4uj8eg/KivyDebug.txt?dl=1

另外,我的 buildozer.spec 文件...

https://www.dropbox.com/s/g5p43jjts49rzza/buildozer.spec?dl=1

编辑:按照这里的建议降级 Cython并没有帮助。EDIT2:尝试将要求更改为 kivy==master。没运气。EDIT3:在源文件夹和 buildozer 文件夹上都尝试了 chmod -R 777 。没运气。

4

1 回答 1

1

好的,我不久前遇到了自己问题的答案,我将其发布在这里,以防其他人犯同样的愚蠢错误。基本上,我没有仔细阅读文档中的说明。说明清楚地指出“导航到您的项目目录并运行:buildozer init”。我没有导航到项目文件夹。我在我的用户目录中构建,因此是“/Users/Travis/”。因此出现“没有这样的文件或目录”错误。

您可能会问“您希望 buildozer 如何知道您的项目在哪里?”

好吧,下一步是配置“buildozer.spec”,在那里,有一个地方可以放置 main.py 的路径,默认情况下是“.”,所以我改变了它。它实际上达到了必须写入任何文件的程度。

所以,如果你和我有同样的问题,你可能只需要更仔细地阅读。

于 2015-06-03T20:29:25.183 回答