Android NDK 15c错误与python-for-android / kivy python 2

时间:2017-11-17 23:33:29

标签: python android-ndk buildozer

使用buildozer编译代码时,代码会出错,我认为是abot(设置APP_ALLOW_MISSING_DEPS = true以允许缺少依赖项) 不确定。

我在buildozer spec文件中复制了错误(log 2)和majore规范。

错误记录

B

规范文件中的更改

[INFO]:    -> running ndk-build V=1 APP_ABI=armeabi-v7a
Exception in thread background thread for pid 14878:
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 "/usr/local/lib/python2.7/dist-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
ErrorReturnCode_2: 

  RAN: /home/sherif/Downloads/android-ndk-r15c-linux-x86_64/android-ndk-r15c/ndk-build V=1 APP_ABI=armeabi-v7a

  STDOUT:
Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-14.    
jni/Android.mk:11: extraneous text after 'ifeq' directive
/home/sherif/Downloads/android-ndk-r15c-linux-x86_64/android-ndk-r15c/build/core/build-binary.mk:688: Android NDK: Module cjpeg depends on undefined modules: cutils    
/home/sherif/Downloads/android-ndk-r15c-linux-x86_64/android-ndk-r15c/build/core/build-binary.mk:701: *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies)    .  Stop.


  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/sherif/Desktop/P2/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 916, in <module>
    main()
  File "/home/sherif/Desktop/P2/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 913, in main
    ToolchainCL()
  File "/home/sherif/Desktop/P2/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 514, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/sherif/Desktop/P2/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 147, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/sherif/Desktop/P2/.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 "/home/sherif/Desktop/P2/.buildozer/android/platform/python-for-android-master/pythonforandroid/recipes/jpeg/__init__.py", line 29, in build_arch
    super(JpegRecipe, self).build_arch(arch)
  File "pythonforandroid/recipe.py", line 710, in build_arch
  File "pythonforandroid/logger.py", line 175, in shprint
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 863, in next
    self.wait()
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 792, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: /home/sherif/Downloads/android-ndk-r15c-linux-x86_64/android-ndk-r15c/ndk-build V=1 APP_ABI=armeabi-v7a

  STDOUT:
Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-14.    
jni/Android.mk:11: extraneous text after 'ifeq' directive
/home/sherif/Downloads/android-ndk-r15c-linux-x86_64/android-ndk-r15c/build/core/build-binary.mk:688: Android NDK: Module cjpeg depends on undefined modules: cutils    
/home/sherif/Downloads/android-ndk-r15c-linux-x86_64/android-ndk-r15c/build/core/build-binary.mk:701: *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies)    .  Stop.


  STDERR:

# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=master --bootstrap=sdl2 --requirements=kivy,pil --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/sherif/Desktop/P2/.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

使用ndk9c时没有错误,但启动时应用程序崩溃。

1 个答案:

答案 0 :(得分:0)

要解决第二个错误,请修改jpeg/build-static.patch:删除单词libcutils

关于&#34;&#39; ifeq&#39;之后的无关文字指令&#34; ,我认为这只是一个警告,可以忽略。