编译Android时出现Buildozer错误:列表索引超出范围

时间:2017-05-13 18:17:54

标签: kivy buildozer

我目前正在尝试编译一个非常简单的Kivy应用,以便在Android上使用。应用程序在桌面(Linux和Windows)上按预期运行,没有错误或警告,但是在编译期间我遇到了标题中给出的错误。以下是编译期间显示的所有内容的完整副本:

buildozer android debug deploy run
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Install platform
# Apache ANT found at /home/freakjoe/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/freakjoe/.buildozer/android/platform/android-sdk-20
# Android NDK found at /home/freakjoe/.buildozer/android/platform/android-ndk-r9c
# Check application requirements
# Check garden requirements
# Compile platform
# Distribution already compiled, pass.
# Build the application #21
# Package the application
Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 9, in <module>
    load_entry_point('buildozer==0.33.dev0', 'console_scripts', 'buildozer')()
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.33.dev0-py2.7.egg/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.33.dev0-py2.7.egg/buildozer/__init__.py", line 1020, in run_command
    self.target.run_commands(args)
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.33.dev0-py2.7.egg/buildozer/target.py", line 91, in run_commands
    func(args)
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.33.dev0-py2.7.egg/buildozer/target.py", line 103, in cmd_debug
    self.buildozer.build()
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.33.dev0-py2.7.egg/buildozer/__init__.py", line 211, in build
    self.target.build_package()
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.33.dev0-py2.7.egg/buildozer/targets/android.py", line 645, in build_package
    self._update_libraries_references(dist_dir)
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.33.dev0-py2.7.egg/buildozer/targets/android.py", line 839, in _update_libraries_references
    if not content[-1].endswith(u'\n'):
IndexError: list index out of range

我没有对通过运行buildozer init创建的.spec文件进行任何更改。我正在使用Python 2.7并运行Linux Mint。

非常感谢任何帮助!

2 个答案:

答案 0 :(得分:1)

根据this Google论坛主题,您的错误已修复,您应该尝试更新Buildozer安装。

  

Mathieu Virbel:

     

我最近解决了一些问题,请尝试掌握。如果它不起作用,   打开一个问题。如果内容[-1不起作用,则可能意味着   引用是空的,因此在它之前的某个地方还有另一个问题。   向我们发送整个日志可能有所帮助。

答案 1 :(得分:1)

我在运行时遇到相同的错误:

buildozer android debug

我认为在编译过程中按下 Ctrl + c 以停止该错误之后,就会出现该错误。之后,错误继续。

buildozer version == 0.35
python 3.6.6
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux

为了解决该错误,我尝试使用:

$ buildozer dist-clean
$ buildozer android clean

但是错误仍然存​​在。

因此,我建议您使用buildozer 0.34

sudo -H pip3 install buildozer==0.34

如果您使用的是python 2.7.x:

sudo -H pip install buildozer==0.34