首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android 15c错误与python-for-android/kivy python 2

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

Stack Overflow用户
提问于 2017-11-17 23:33:28
回答 1查看 421关注 0票数 0

在使用buildozer编译代码时,代码会出现一个错误,我认为它的abot (将APP_ALLOW_MISSING_DEPS=true设置为允许丢失依赖项)不能确定。

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

错误日志

代码语言:javascript
复制
[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

在Spec文件中的更改

代码语言:javascript
复制
> # (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没有错误,但是应用程序在启动时崩溃了。

EN

回答 1

Stack Overflow用户

发布于 2017-11-18 09:54:22

要修复第二个错误,请编辑jpeg/Build-Static.修补程序:删除单词libcutils

关于“ifeq指令后的无关文本”,我认为这只是一个警告,可以忽略。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47360806

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档