【已解决】cocos code ide 生成apk

写了一个游戏,真机运行 也没问题,但是最后 生成apk 失败,麻烦大神看下 怎么改, 下面是控制台输出日志


13:20:38 ---android build start---
13:20:40 Updated project.properties
13:20:40 Updated local.properties
13:20:40 Updated file D:\cocos_project\Parkour\frameworks\runtime-src\proj.android\proguard-project.txt
13:20:40 It seems that there are sub-projects. If you want to update them
13:20:40 please use the --subprojects parameter.
13:20:40 Android NDK: WARNING: APP_PLATFORM android-21 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml    
13:20:41 make.exe: Entering directory `D:/cocos_project/Parkour/frameworks/runtime-src/proj.android'
13:20:41  Gdbserver      :  libs/armeabi/gdbserver
13:20:41  Gdbsetup       : libs/armeabi/gdb.setup
13:20:41 make.exe: Leaving directory `D:/cocos_project/Parkour/frameworks/runtime-src/proj.android'
13:20:41 make.exe: *** No rule to make target `D:/android-ndk/sources/android/cpufeatures/cpu-features.c', needed by `obj/local/armeabi/objs-debug/cpufeatures/cpu-features.o'.  Stop.
13:20:41 ---android build end---
13:20:41 Running command: compile
13:20:41 Building mode: debug
13:20:41 running: '"D:\android-sdk\tools\android" update project -t android-22 -p D:\cocos_project\Parkour\frameworks\runtime-src\proj.android'
13:20:41 building native
13:20:42 NDK build mode: debug
13:20:42 NDK_TOOLCHAIN_VERSION: 4.9
13:20:42 running: '"D:\android-ndk-r10e\ndk-build" -C D:\cocos_project\Parkour\frameworks\runtime-src\proj.android -j1 NDK_MODULE_PATH=D:\Cocos\frameworks/cocos2d-x-3.5;D:\Cocos\frameworks/cocos2d-x-3.5/cocos;D:\Cocos\frameworks/cocos2d-x-3.5/external NDK_TOOLCHAIN_VERSION=4.9 NDK_DEBUG=1'
13:20:42 Ndk build failed!

似乎是 AndroidManifest.xml 的android:minSdkVersion 值不对,我改成22后 再打包 控制台输出 日志变了

13:32:58 —android build start—
13:33:00 Updated project.properties
13:33:00 Updated local.properties
13:33:00 Updated file D:\cocos_project\Parkour\frameworks\runtime-src\proj.android\proguard-project.txt
13:33:00 It seems that there are sub-projects. If you want to update them
13:33:00 please use the --subprojects parameter.
13:33:01 make.exe: Entering directory D:/cocos_project/Parkour/frameworks/runtime-src/proj.android' 13:33:01 Gdbserver : libs/armeabi/gdbserver 13:33:01 Gdbsetup : libs/armeabi/gdb.setup 13:33:01 make.exe: Leaving directory D:/cocos_project/Parkour/frameworks/runtime-src/proj.android’
13:33:01 make.exe: *** No rule to make target D:/android-ndk/sources/android/cpufeatures/cpu-features.c', needed by obj/local/armeabi/objs-debug/cpufeatures/cpu-features.o’. Stop.
13:33:02 Running command: compile
13:33:02 Building mode: debug
13:33:02 running: ‘“D:\android-sdk\tools\android” update project -t android-22 -p D:\cocos_project\Parkour\frameworks\runtime-src\proj.android’
13:33:02 building native
13:33:02 NDK build mode: debug
13:33:02 NDK_TOOLCHAIN_VERSION: 4.9
13:33:02 running: ‘“D:\android-ndk-r10e\ndk-build” -C D:\cocos_project\Parkour\frameworks\runtime-src\proj.android -j1 NDK_MODULE_PATH=D:\Cocos\frameworks/cocos2d-x-3.5;D:\Cocos\frameworks/cocos2d-x-3.5/cocos;D:\Cocos\frameworks/cocos2d-x-3.5/external NDK_TOOLCHAIN_VERSION=4.9 NDK_DEBUG=1’
13:33:02 Ndk build failed!
13:33:02 —android build end—

13:33:01 make.exe: *** No rule to make target D:/android-ndk/sources/android/cpufeatures/cpu-features.c', needed by obj/local/armeabi/objs-debug/cpufeatures/cpu-features.o’. Stop.
主要是这一句错误了
你的ndk版本是多少?

android-ndk-r10e 昨晚在android 官网下的最新的

他输出的 路径不对 D:\android-ndk-r10e\sources\android 这个在哪里修改??

换r10d试试

已经换了 r10d 版本了,ide 里面的 settings – cocos – android NDK Location 也设置为 D:\android-ndk-r10d

14:54:13 —android build start—
14:54:41 Updated project.properties
14:54:41 Updated local.properties
14:54:41 Updated file D:\cocos_project\Parkour\frameworks\runtime-src\proj.android\proguard-project.txt
14:54:41 It seems that there are sub-projects. If you want to update them
14:54:41 please use the --subprojects parameter.
14:54:46 make.exe: Entering directory D:/cocos_project/Parkour/frameworks/runtime-src/proj.android' 14:54:46 Gdbserver : libs/armeabi/gdbserver 14:54:46 Gdbsetup : libs/armeabi/gdb.setup 14:54:50 make.exe: Leaving directory D:/cocos_project/Parkour/frameworks/runtime-src/proj.android’
14:54:50 make.exe: *** No rule to make target D:/android-ndk/sources/android/cpufeatures/cpu-features.c', needed by obj/local/armeabi/objs-debug/cpufeatures/cpu-features.o’. Stop.
14:54:50 Running command: compile
14:54:50 Building mode: debug
14:54:50 running: ‘“D:\android-sdk\tools\android” update project -t android-22 -p D:\cocos_project\Parkour\frameworks\runtime-src\proj.android’
14:54:50 building native
14:54:50 NDK build mode: debug
14:54:50 NDK_TOOLCHAIN_VERSION: 4.9
14:54:50 running: ‘“D:\android-ndk-r10d\ndk-build” -C D:\cocos_project\Parkour\frameworks\runtime-src\proj.android -j1 NDK_MODULE_PATH=D:\Cocos\frameworks/cocos2d-x-3.5;D:\Cocos\frameworks/cocos2d-x-3.5/cocos;D:\Cocos\frameworks/cocos2d-x-3.5/external NDK_TOOLCHAIN_VERSION=4.9 NDK_DEBUG=1’
14:54:50 Ndk build failed!
14:54:50 —android build end—

删掉obj文件夹生成的东西试试

找到问题了,是我环境变量里面的配置错了,有些目录做了移动,但是路径没修改