Buildozer编译失败:找不到应用程序项目目录? [英] Buildozer compilation failed: Could not find application project directory?

查看:1080
本文介绍了Buildozer编译失败:找不到应用程序项目目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是kivy的新手,当我尝试编译buildozer时遇到错误. 第一个错误是有关下载食谱的.我手动下载了软件包,也在 buildozer.spec 文件中定义了它们的路径:

I'm new to kivy and when i try to compile buildozer i am getting an error. The first error was about downloading recipes. I downloaded the packages manually, also i defined their path in buildozer.spec file:

# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = kivy,hostpython2,python2,six,pyjnius,kivy,sdl2_image

# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy
requirements.source.hostpython2 = ~/.buildozer/hostpython2
requirements.source.python2 = ~/.buildozer/python2
requirements.source.six = ~/.buildozer/six
requirements.source.pyjnius = ~/.buildozer/pyjnius
requirements.source.kivy = ~/.buildozer/kivy
requirements.source.sdl2_image = ~/.buildozer/sdl2_image

然后,我重试了该编译:

And then, i retried the compilation:

sudo buildozer -v android debug

不过一段时间后,我看到了另一个错误:

However after a while i saw a different error:

  STDOUT:
Android NDK: Could not find application project directory !    
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.    
/home/tanberk/.buildozer/android/platform/android-ndk-r9c/build/core/build-local.mk:148: *** Android NDK: Aborting    .  Stop.


  STDERR:

# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy,hostpython2,python2,six,pyjnius,kivy,sdl2_image --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/tanberk/İndirilenler/.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

有人可以帮助我解决此问题吗?

Can anyone help me to fix this problem?

谢谢.

操作系统: Ubuntu 17.04

OS: Ubuntu 17.04

Python: 3.5.2

@ikolim

我尝试按照这些步骤进行操作,现在错误类型为UnicodeError.

I tried to follow the steps, now the error type is UnicodeError.

输出中有一个警告.

[WARNING]: NDK version was set as r10.3.2, but checking the NDK dir claims it is 10.3.2, or should i download version **r8**?
[WARNING]: The build will try to continue, but it may fail and you should check that your setting is correct.
[WARNING]: If the NDK dir result is correct, you don't need to manually set the NDK ver.

我应该怎么做,是否有与 10.3.2 不同的 r10.3.2 版本?还是我应该下载版本 r8 ?

What should i do, is there a r10.3.2 version which is different than 10.3.2? Or should i download version r8?

整个输出如下.

tanberk@kutlu:~/İndirilenler$ buildozer android debug deploy run
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian 'dpkg' paket yönetim programı sürüm 1.18.10 (amd64).
Bu bir özgür yazılımdır; kopyalama şartları için GNU Genel Kamu Lisansı
sürüm 2 ya da daha yenisine bakın. Hiçbir garanti verilmez.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /usr/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-8-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/tanberk/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/tanberk/.buildozer/android/platform/android-sdk-20
# Android NDK found at /opt/crystax-ndk-10.3.2
# Check application requirements
# Check garden requirements
# Compile platform
# Run '/usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3crystax,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/tanberk/\xc4\xb0ndirilenler/.buildozer/android/platform/build'
# Cwd /home/tanberk/İndirilenler/.buildozer/android/platform/python-for-android-master
[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
[WARNING]: NDK version was set as r10.3.2, but checking the NDK dir claims it is 10.3.2.
[WARNING]: The build will try to continue, but it may fail and you should check that your setting is correct.
[WARNING]: If the NDK dir result is correct, you don't need to manually set the NDK ver.
[INFO]:    Using Crystax NDK r10.3.2
[INFO]:    Found virtualenv at /usr/local/bin/virtualenv
[INFO]:    Found the following toolchain versions: ['4.9', '5', 'clang3.6', 'clang3.7']
[INFO]:    Picking the latest gcc toolchain, here 5
[INFO]:    No existing dists meet the given requirements!
[INFO]:    No dist exists that meets your requirements, so one will be built.
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, 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/tanberk/İndirilenler/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 916, in <module>
    main()
  File "/home/tanberk/İndirilenler/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 913, in main
    ToolchainCL()
  File "/home/tanberk/İndirilenler/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 514, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/tanberk/İndirilenler/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 147, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/tanberk/İndirilenler/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 169, in build_dist_from_args
    = get_recipe_order_and_bootstrap(ctx, dist.recipes, bs)
  File "pythonforandroid/graph.py", line 113, in get_recipe_order_and_bootstrap
    name, ctx, orders=new_possible_orders)
  File "pythonforandroid/graph.py", line 36, in recursively_collect_orders
    recipe = Recipe.get_recipe(name, ctx)
  File "pythonforandroid/recipe.py", line 629, in get_recipe
    recipe_file = join(recipes_dir, name, '__init__.py')
  File "/usr/lib/python2.7/posixpath.py", line 73, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 14: ordinal not in range(128)
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3crystax,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/tanberk/İndirilenler/.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
tanberk@kutlu:~/İndirilenler$ 

当我看着#Command Failed:时,我怀疑程序是使用python2而不是python3运行的吗?

And when i look at the #Command Failed: i suspect that the program runs with python2 instead of python3?

我更改了目录,但它再次出现错误.

I changed the directory but it gave an error again.

下面是新的错误消息.

tanberk@kutlu:~/Android$ buildozer android debug deploy run
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian 'dpkg' paket yönetim programı sürüm 1.18.10 (amd64).
Bu bir özgür yazılımdır; kopyalama şartları için GNU Genel Kamu Lisansı
sürüm 2 ya da daha yenisine bakın. Hiçbir garanti verilmez.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /usr/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-8-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/tanberk/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/tanberk/.buildozer/android/platform/android-sdk-20
# Android NDK found at /opt/crystax-ndk-10.3.2
# Check application requirements
# Check garden requirements
# Compile platform
# Run '/usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=hostpython3crystax,python3crystax,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/tanberk/Android/.buildozer/android/platform/build'
# Cwd /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[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
[WARNING]: NDK version was set as r10.3.2, but checking the NDK dir claims it is 10.3.2.
[WARNING]: The build will try to continue, but it may fail and you should check that your setting is correct.
[WARNING]: If the NDK dir result is correct, you don't need to manually set the NDK ver.
[INFO]:    Using Crystax NDK r10.3.2
[INFO]:    Found virtualenv at /usr/local/bin/virtualenv
[INFO]:    Found the following toolchain versions: ['4.9', '5', 'clang3.6', 'clang3.7']
[INFO]:    Picking the latest gcc toolchain, here 5
[INFO]:    No existing dists meet the given requirements!
[INFO]:    No dist exists that meets your requirements, so one will be built.
[INFO]:    Found a single valid recipe set: [u'hostpython3crystax', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', u'python3crystax', 'sdl2', 'six', 'pyjnius', u'kivy']
[INFO]:    The selected bootstrap is sdl2
[INFO]:    # Creating dist with sdl2 bootstrap
[INFO]:    Dist will have name myapp and recipes (hostpython3crystax, python3crystax, kivy)
[INFO]:    Dist will also contain modules () installed from pip
[INFO]:    -> running cp -r /home/tanberk/Android/.b...(and 189 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3crystax
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Recipe build order is [u'hostpython3crystax', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', u'python3crystax', 'sdl2', 'six', 'pyjnius', u'kivy']
[INFO]:    # Downloading recipes 
[INFO]:    Downloading hostpython3crystax
[INFO]:    Skipping hostpython3crystax download as no URL is set
[INFO]:    Downloading sdl2_image
[INFO]:    -> running mkdir -p /home/tanberk/Android...(and 54 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/packages/sdl2_image
[INFO]:    -> running basename https://www.libsdl.or...(and 52 more)
[INFO]:    sdl2_image download already cached, skipping
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading sdl2_mixer
[INFO]:    -> running mkdir -p /home/tanberk/Android...(and 54 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/packages/sdl2_mixer
[INFO]:    -> running basename https://www.libsdl.or...(and 52 more)
[INFO]:    sdl2_mixer download already cached, skipping
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading sdl2_ttf
[INFO]:    -> running mkdir -p /home/tanberk/Android...(and 52 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/packages/sdl2_ttf
[INFO]:    -> running basename https://www.libsdl.org...(and 48 more)
[INFO]:    sdl2_ttf download already cached, skipping
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading python3crystax
[INFO]:    -> running mkdir -p /home/tanberk/Android...(and 58 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/packages/python3crystax
[INFO]:    -> running basename 
[INFO]:    -> running rm -f .mark-
[INFO]:    -> running touch .mark-
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading sdl2
[INFO]:    -> running mkdir -p /home/tanberk/Android/...(and 47 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/packages/sdl2
[INFO]:    -> running basename https://www.libsdl.org...(and 26 more)
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading six
[INFO]:    -> running mkdir -p /home/tanberk/Android/...(and 46 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/packages/six
[INFO]:    -> running basename https://pypi.python.or...(and 40 more)
[INFO]:    six download already cached, skipping
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading pyjnius
[INFO]:    -> running mkdir -p /home/tanberk/Android...(and 51 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/packages/pyjnius
[INFO]:    -> running basename https://github.com/kiv...(and 28 more)
[INFO]:    pyjnius download already cached, skipping
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading kivy
[INFO]:    -> running mkdir -p /home/tanberk/Android/...(and 47 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/packages/kivy
[INFO]:    -> running basename https://github.com/kiv...(and 25 more)
     [INFO]:    kivy download already cached, skipping                         
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    # Building all recipes for arch armeabi-v7a
[INFO]:    # Unpacking recipes
[INFO]:    Unpacking hostpython3crystax for armeabi-v7a
[INFO]:    Skipping hostpython3crystax unpack as no URL is set
[INFO]:    Unpacking sdl2_image for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.or...(and 52 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3crystax/jni
[INFO]:    sdl2_image is already unpacked, skipping
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking sdl2_mixer for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.or...(and 52 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3crystax/jni
[INFO]:    sdl2_mixer is already unpacked, skipping
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking sdl2_ttf for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org...(and 48 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3crystax/jni
[INFO]:    sdl2_ttf is already unpacked, skipping
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking python3crystax for armeabi-v7a
[INFO]:    -> running basename 
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/build/other_builds/python3crystax-version3.5/armeabi-v7a
[INFO]:    python3crystax is already unpacked, skipping
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking sdl2 for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org...(and 26 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3crystax/jni
[INFO]:    sdl2 is already unpacked, skipping
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking six for armeabi-v7a
[INFO]:    -> running basename https://pypi.python.or...(and 40 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/build/other_builds/six-python3crystax/armeabi-v7a
[INFO]:    six is already unpacked, skipping
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking pyjnius for armeabi-v7a
[INFO]:    -> running basename https://github.com/kiv...(and 28 more)
           work[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a
[INFO]:    pyjnius is already unpacked, skipping
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking kivy for armeabi-v7a
[INFO]:    -> running basename https://github.com/kiv...(and 25 more)
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a
[INFO]:    kivy is already unpacked, skipping
[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    # Prebuilding recipes
[INFO]:    Prebuilding hostpython3crystax for armeabi-v7a
[INFO]:    hostpython3crystax has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding sdl2_image for armeabi-v7a
[INFO]:    sdl2_image has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2_image[armeabi-v7a]
[INFO]:    sdl2_image already patched, skipping
[INFO]:    Prebuilding sdl2_mixer for armeabi-v7a
[INFO]:    sdl2_mixer has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2_mixer[armeabi-v7a]
[INFO]:    sdl2_mixer already patched, skipping
[INFO]:    Prebuilding sdl2_ttf for armeabi-v7a
[INFO]:    sdl2_ttf has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding python3crystax for armeabi-v7a
[INFO]:    python3crystax has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding sdl2 for armeabi-v7a
[INFO]:    sdl2 has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2[armeabi-v7a]
[INFO]:    sdl2 already patched, skipping
[INFO]:    Prebuilding six for armeabi-v7a
[INFO]:    six has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding pyjnius for armeabi-v7a
[INFO]:    pyjnius has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for pyjnius[armeabi-v7a]
[INFO]:    pyjnius already patched, skipping
[INFO]:    Prebuilding kivy for armeabi-v7a
[INFO]:    kivy has no prebuild_armeabi_v7a, skipping
[INFO]:    # Building recipes
[INFO]:    Building hostpython3crystax for armeabi-v7a
[INFO]:    Building sdl2_image for armeabi-v7a
[INFO]:    Building sdl2_mixer for armeabi-v7a
[INFO]:    Building sdl2_ttf for armeabi-v7a
[INFO]:    Building python3crystax for armeabi-v7a
[INFO]:    Building sdl2 for armeabi-v7a
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3crystax/jni
[INFO]:    -> running ndk-build V=1
           working: /opt/crystax-ndk-10.3.2/t[INFO]:    <- directory context /home/tanberk/Android/.buildozer/android/platform/python-for-android-master
[INFO]:    Building six for armeabi-v7a
[INFO]:    six apparently isn't already in site-packages
[INFO]:    Installing six into site-packages
[INFO]:    -> directory context /home/tanberk/Android/.buildozer/android/platform/build/build/other_builds/six-python3crystax/armeabi-v7a/six
[INFO]:    -> running python3.5 setup.py install -O2...(and 107 more)
           working:     addsitedir(sitedir, known_paths)    Exception in thread background thread for pid 11620:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/tanberk/.local/lib/python2.7/site-packages/sh.py", line 2170, in background_thread
    handle_exit_code(exit_code)
  File "/home/tanberk/.local/lib/python2.7/site-packages/sh.py", line 1929, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/tanberk/.local/lib/python2.7/site-packages/sh.py", line 672, in handle_command_exit_code
    raise exc
ErrorReturnCode_1: 

  RAN: /usr/bin/python3.5 setup.py install -O2 --root=/home/tanberk/Android/.buildozer/android/platform/build/build/python-installs/myapp --install-lib=.

  STDOUT:
Failed to import the site module
Traceback (most recent call last):
  File "/usr/lib/python3.5/site.py", line 580, in <module>
    main()
  File "/usr/lib/python3.5/site.py", line 567, in main
    known_paths = addsitepackages(known_paths)
  File "/usr/lib/python3.5/site.py", line 344, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "/usr/lib/python3.5/site.py", line 212, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "/usr/lib/python3.5/site.py", line 168, in addpackage
    for n, line in enumerate(f):
  File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 14: ordinal not in range(128)


  STDERR:


Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, 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/tanberk/Android/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 916, in <module>
    main()
  File "/home/tanberk/Android/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 913, in main
    ToolchainCL()
  File "/home/tanberk/Android/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 514, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/tanberk/Android/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 147, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/tanberk/Android/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 192, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "pythonforandroid/build.py", line 572, in build_recipes
  File "pythonforandroid/recipe.py", line 806, in build_arch
  File "pythonforandroid/recipe.py", line 839, in install_python_package
  File "pythonforandroid/logger.py", line 175, in shprint
  File "/home/tanberk/.local/lib/python2.7/site-packages/sh.py", line 720, in next
    self.wait()
  File "/home/tanberk/.local/lib/python2.7/site-packages/sh.py", line 651, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/tanberk/.local/lib/python2.7/site-packages/sh.py", line 672, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /usr/bin/python3.5 setup.py install -O2 --root=/home/tanberk/Android/.buildozer/android/platform/build/build/python-installs/myapp --install-lib=.

  STDOUT:
Failed to import the site module
Traceback (most recent call last):
  File "/usr/lib/python3.5/site.py", line 580, in <module>
    main()
  File "/usr/lib/python3.5/site.py", line 567, in main
    known_paths = addsitepackages(known_paths)
  File "/usr/lib/python3.5/site.py", line 344, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "/usr/lib/python3.5/site.py", line 212, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "/usr/lib/python3.5/site.py", line 168, in addpackage
    for n, line in enumerate(f):
  File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 14: ordinal not in range(128)


  STDERR:

# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=hostpython3crystax,python3crystax,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/tanberk/Android/.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
tanberk@kutlu:~/Android$ 

推荐答案

我能够成功运行buildozer.我正在使用Ubuntu 16.04 LTS,Kivy 1.10.0和Python 3.5.我做了以下事情:

I am able to run buildozer successfully. I am using Ubuntu 16.04 LTS, Kivy 1.10.0, and Python 3.5. I did the following:

  1. 从源代码安装buildozer:

  1. Install buildozer from source:

git clone https://github.com/kivy/buildozer
cd buildozer
python setup.py build
sudo pip install -e.

git clone https://github.com/kivy/buildozer
cd buildozer
python setup.py build
sudo pip install -e .

安装Cython(/usr/local/lib/python3.5/dist-packages中的pip 9.0.1)

Install Cython (pip 9.0.1 from /usr/local/lib/python3.5/dist-packages)

sudo pip install --upgrade cython == 0.26

sudo pip install --upgrade cython==0.26

进入您的应用程序目录并执行以下命令来创建buildozer.spec文件:

Go into your application directory and create buildozer.spec file by executing:

buildozer初始化

buildozer init

编辑buildozer.spec文件,并确保以下行位于其中:

Edit the buildozer.spec file and make sure the following lines are in:

#需要python3crystax:
需求= hostpython3,python3crystax,kivy
...
#要使用的Kivy版本
osx.kivy_version = 1.10.0
...
#(str)要使用的Android NDK版本
android.ndk = 10.3.2
...
#(str)Android NDK目录(如果为空,将自动下载.)
android.ndk_path =/opt/crystax-ndk-10.3.2

# Require python3crystax:
requirements = hostpython3,python3crystax,kivy
...
# Kivy version to use
osx.kivy_version = 1.10.0
...
# (str) Android NDK version to use
android.ndk = 10.3.2
...
# (str) Android NDK directory (if empty, it will be automatically downloaded.)
android.ndk_path = /opt/crystax-ndk-10.3.2

最后,在手机上构建,部署和运行该应用程序:

Finally, build, deploy and run the app on your phone:

buildozer android调试部署运行

buildozer android debug deploy run

如果第一次失败,请执行以下操作:

If it failed the first time, execute the following:

buildozer android清洁调试部署运行

buildozer android clean debug deploy run

注意

请针对您好的世界应用程序尝试buildozer( Kivy基础知识-最少的应用程序)

这篇关于Buildozer编译失败:找不到应用程序项目目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆