编译成APK时,Buildozer失败了

时间:2018-02-04 14:03:05

标签: python apk kivy spyder buildozer

这是应用程序:

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sat Feb  3 23:11:38 2018

@author: djaber
"""


from kivy.app import App
from kivy.uix.scatter import Scatter
#from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.floatlayout import FloatLayout

class TutorialApp(App):
    def build(self):
        f = FloatLayout()
        s= Scatter()
        l= Label(text= "Hello!",
                      font_size= 150)
        f.add_widget(s)
        s.add_widget(l)
        return f
# This is necessary to run the app
if __name__ == "__main__":
    TutorialApp().run()

我将脚本保存为“main.py”,以便被Buildozer识别。

我使用命令“buildozer android debug”运行Buildozer 我花了几分钟下载了一些相关的软件包。但是,最终失败了。我收到以下错误消息(日志设置为2以显示详细的错误消息)。

djaber@djaber-ThinkPad-T440s ~/APK buider $ buildozer android debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian `dpkg' package management program version 1.17.5 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /home/djaber/anaconda2/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-7-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/keytool
# Install platform
# Run 'pip install -q --user "appdirs" "colorama>=0.3.3" "sh>=1.10,<1.12.5" "jinja2" "six"'
# Cwd None
# Apache ANT found at /home/djaber/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/djaber/.buildozer/android/platform/android-sdk-20
# Android NDK found at /home/djaber/.buildozer/android/platform/android-ndk-r9c
# Check application requirements
# Check garden requirements
# Compile platform
# Run '/usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/djaber/APK buider/.buildozer/android/platform/build'
# Cwd /home/djaber/APK buider/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Found Android API target in $ANDROIDAPI
[INFO]:    Available Android APIs are (19)
[INFO]:    Requested API target 19 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK
[INFO]:    Got NDK version from $ANDROIDNDKVER
[INFO]:    Using Google NDK r9c
[INFO]:    Found virtualenv at /usr/local/bin/virtualenv
[INFO]:    ccache is missing, the build will not be optimized in the future.
[INFO]:    Found the following toolchain versions: ['4.6', '4.8', 'clang3.3']
[INFO]:    Picking the latest gcc toolchain, here 4.8
[INFO]:    No existing dists meet the given requirements!
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/djaber/APK buider/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 978, in <module>
    main()
  File "/home/djaber/APK buider/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 975, in main
    ToolchainCL()
  File "/home/djaber/APK buider/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 512, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/djaber/APK buider/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 147, in wrapper_func
    info_notify('No dist exists that meets your requirements, '
  File "pythonforandroid/logger.py", line 101, in info_notify
    info('{}{}{}{}'.format(Err_Style.BRIGHT, Err_Fore.LIGHTBLUE_EX, s,
  File "pythonforandroid/logger.py", line 70, in __getattr__
    return getattr(self._real, key) if self._enabled else self._dict[key]
AttributeError: 'AnsiCodes' object has no attribute 'LIGHTBLUE_EX'
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/djaber/APK buider/.buildozer/android/platform/build
# 
# 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

构建APK有什么缺失?

0 个答案:

没有答案