在Mac OS X上从Kivy创建APK在编译后失败

时间:2021-10-12 02:44:07

My background is in HTML/JS, so compiling is new for me. While attempting to build my python project in Kivy to an Android .apk, I am getting an error I do not understand:

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

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

Here is a portion of the tail end of the debug output...

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

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

Here is the full debug, for those who want it...

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

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

Also, my buildozer.spec file...

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

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

EDIT: Downgrading Cython per the advice HERE did not help. EDIT2: Tried changing requirements to kivy==master. No luck. EDIT3: Tried chmod -R 777 on both source and buildozer folders. No luck.

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

1 个解决方案

#1


OK, I came across the answer to my own problem a while ago and I'm posting it here in case someone else makes the same boneheaded mistake. Basically, I did not read the instructions carefully enough in the documentation. The instructions clearly state "navigate to your project directory and run: buildozer init". I did not navigate to the project folder. I was building in my user directory, hence "/Users/Travis/". Hence the "No such file or directory" error.

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

You may be asking "How do you expect buildozer to know where your project is?"

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

Well, the next step says to configure "buildozer.spec", and in there, there is a place to put your path to the main.py, which by default is ".", so I changed that. It actually worked up to the point that it has to write any files.

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

So, if you're having the same issue as me, you might just need to read more carefully.

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

#1


OK, I came across the answer to my own problem a while ago and I'm posting it here in case someone else makes the same boneheaded mistake. Basically, I did not read the instructions carefully enough in the documentation. The instructions clearly state "navigate to your project directory and run: buildozer init". I did not navigate to the project folder. I was building in my user directory, hence "/Users/Travis/". Hence the "No such file or directory" error.

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

You may be asking "How do you expect buildozer to know where your project is?"

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

Well, the next step says to configure "buildozer.spec", and in there, there is a place to put your path to the main.py, which by default is ".", so I changed that. It actually worked up to the point that it has to write any files.

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

So, if you're having the same issue as me, you might just need to read more carefully.

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