代码之家  ›  专栏  ›  技术社区  ›  dildeolupbiten

Buildozer编译失败:找不到应用程序项目目录?

  •  0
  • dildeolupbiten  · 技术社区  · 7 年前

    食谱 . 我手动下载了这些包,并且在中定义了它们的路径 文件:

    # (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
    

    然后,我重试编译:

    sudo buildozer -v android debug
    

      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
    

    有人能帮我解决这个问题吗?

    操作系统:

    蟒蛇:

    编辑1:

    @伊科利姆

    我试着遵循这些步骤,现在错误类型是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.
    

    我该怎么办,有没有 版本不同于 ? 或者我应该下载版本 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:

    下面是新的错误消息。

    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$ 
    
    1 回复  |  直到 4 年前
        1
  •  2
  •   ikolim    7 年前

    我能够成功运行buildozer。我使用的是Ubuntu 16.04 LTS、Kivy 1.10.0和Python 3.5。我做了以下工作:

    安装支持python3的Buildozer:

    1. git克隆 https://github.com/kivy/buildozer
      cd构建器
      python设置。py构建
      sudo pip安装-e。

    2. https://www.crystax.net/en/download

    3. 安装Cython(来自/usr/local/lib/python3.5/dist包的pip 9.0.1)

      sudo pip安装--升级cython==0.26

    4. buildozer初始化

    5. #需要python3crystax:
      要求=主机Python3、python3crystax、kivy
      ...
      #要使用的Kivy版本
      osx。kivy_版本=1.10.0

      #(str)要使用的Android NDK版本

      ...
      #(str)Android NDK目录(如果为空,将自动下载。)
      安卓ndk_路径=/opt/crystax-ndk-10.3.2



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

      buildozer android清理调试部署运行

    请在hello world应用程序上试用buildozer( Kivy Basics - minimal application ).

    enter image description here