2017-11-17 184 views
0

在使用buildozer编译代码时,代码给出了一个错误,我认为它的abot(设置APP_ALLOW_MISSING_DEPS = true允许缺少依赖关系) bt不确定。Android NDK 15c错误与python-for-android/kivy python 2

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

错误日志

[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 

变化规格文件

> # (str) Title of your application title = Crysteg 

> # (str) Package name package.name = master 
> # (str) Application versioning (method 1) version = 3.0 

> # comma seperated e.g. requirements = sqlite3,kivy 
requirements = kivy,pil 

> # change the major version of python used by the app 
osx.python_version = 2 

> # Kivy version to use 
osx.kivy_version = 1.9.1 

> # (list) Permissions 
> #android.permissions = INTERNET 
> 
> # (int) Android API to use 
> #android.api = 19 
> 
> # (int) Minimum API required 
> #android.minapi = 9 
> 
> # (int) Android SDK version to use 
#android.sdk = 20 

# (str) Android NDK version to use a 
ndroid.ndk = 15 

# (bool) Use --private data storage (True) or --dir public storage (False) 
#android.private_storage = True 

# (str) Android NDK directory (if empty, it will be automatically downloaded.) 
#android.ndk_path = 
android.ndk_path = ~/Downloads/android-ndk-r15c-linux-x86_64/android-ndk-r15c 
# (str) Android SDK directory (if empty, it will be automatically downloaded.) 

#android.sdk_path = 
android.sdk_path = ~/Downloads/android-sdk-linux 

# (str) ANT directory (if empty, it will be automatically downloaded.) 
#android.ant_path = 

# (bool) If True, then skip trying to update the Android sdk 
# This can be useful to avoid excess Internet downloads or save time 
> # when an update is due and you just want to test/build your package 
> # android.skip_update = False 

# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86 android.arch = armeabi-v7a 



# (str) Bootstrap to use for android builds 
# p4a.bootstrap = sdl2 

[buildozer] 

# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output)) log_level = 2 

# (int) Display warning if buildozer is run as root (0 = False, 1 = True) warn_on_root = 1 

# (str) Path to build artifact storage, absolute or relative to spec file 
# build_dir = ./.buildozer 


# (str) Path to build output (i.e. .apk, .ipa) storage 
# bin_dir = ./bin 

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

回答

0

要修复第二个错误,请编辑jpeg/build-static.patch:删除单词libcutils

关于“ifeq'指令”后的无关文字,我相信这只是一个警告,可以忽略。