cocos2d-x 使用了 cocos new -p com.fly.test -l lua 创建了工程,到工程目录下执行编译命令如下
cocos compile -p android -m release
编译日志
Successfully started process ‘command ‘D:\work\dev_env\android-ndk-r16b\ndk-build.cmd’’
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_audioengine_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= CCComponentLua.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_3d_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_cocosdenshion_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_cocosbuilder_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_csloader_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_studio_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua-cocos-studio-conversions.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_spine_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_experimental_video_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_ui_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_experimental_webview_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_extension_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_physics3d_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_navmesh_auto.cpp
In file included from
D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/scripting/lua-bindings/proj.android/…/auto/lua_cocos2dx_physics3d_auto.cp
p
In file included from D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/3d/…\physics3d/CCPhysics3D.h:55:
In file included from D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/scripting/lua-bindings/proj.android/…/…/…/…/exte
rnal/bullet/prebuilt/android/…/…/include\bullet/btBulletCollisionCommon.h:35:
In file included from D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/…/external/bullet/include/bullet/BulletCollision/Co
llisionShapes/btBvhTriangleMeshShape.h:22:
In file included from D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/…/external/bullet/include/bullet/BulletCollision/Co
llisionShapes/btTriangleInfoMap.h:20:
D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/…/external/bullet/include/bullet\LinearMath/btHashMap.h
:20 fatal error: ‘btAlignedObjectArray.h’ file not found
#include “btAlignedObjectArray.h”
^~~~~~~~~~~~~~~~~~~~~~~~
1
error generated.
make: *** [D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/build/intermediates/ndkBuild/release/obj/local/armeabi-v7a/objs/cocos2d_lua_static/__/auto/lua_
cocos2dx_physics3d_auto.o] Error 1
make: *** Waiting for unfinished jobs…
:MyLuaGame:externalNativeBuildRelease (Thread[Task worker for ‘:’ Thread 2,5,main]) completed. Took 17.046 secs.
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:MyLuaGame:externalNativeBuildRelease’.
Build command failed.
Error while executing process D:\work\dev_env\android-ndk-r16b\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=D:\work\code\upgraded_proj\test\MyLuaGame\frameworks\r
untime-src\proj.android\app\jni\Android.mk NDK_APPLICATION_MK=D:\work\code\upgraded_proj\test\MyLuaGame\frameworks\runtime-src\proj.android\app\jni\Application.mk APP_ABI=armeabi-v7a NDK_A
LL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-14 NDK_OUT=D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/build/intermediates/ndkBuild/release/obj N
DK_LIBS_OUT=D:\work\code\upgraded_proj\test\MyLuaGame\frameworks\runtime-src\proj.android\app\build\intermediates\ndkBuild\release\lib NDK_TOOLCHAIN_VERSION=clang -j4 NDK_DEBUG=0 D:/work/c
ode/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/build/intermediates/ndkBuild/release/obj/local/armeabi-v7a/libcocos2dlua.so}
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_audioengine_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= CCComponentLua.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_3d_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_cocosdenshion_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_cocosbuilder_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_csloader_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_studio_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua-cocos-studio-conversions.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_spine_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_experimental_video_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_ui_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_experimental_webview_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_extension_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_physics3d_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_lua_static <= lua_cocos2dx_navmesh_auto.cpp
In file included from D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/scripting/lua-bindings/proj.android/…/auto/lua_co
cos2dx_physics3d_auto.cpp
In file included from D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/3d/…\physics3d/CCPhysics3D.h:55:
In file included from D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/scripting/lua-bindings/proj.android/…/…/…/…/ex
ternal/bullet/prebuilt/android/…/…/include\bullet/btBulletCollisionCommon.h:35:
In file included from D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/…/external/bullet/include/bullet/BulletCollision/
CollisionShapes/btBvhTriangleMeshShape.h:22:
In file included from D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/…/external/bullet/include/bullet/BulletCollision/
CollisionShapes/btTriangleInfoMap.h:20:
D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/…/external/bullet/include/bullet\LinearMath/btHashMap.h:20 fatal er
ror: ‘btAlignedObjectArray.h’ file not found
#include “btAlignedObjectArray.h”
^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [D:/work/code/upgraded_proj/test/MyLuaGame/frameworks/runtime-src/proj.android/app/build/intermediates/ndkBuild/release/obj/local/armeabi-v7a/objs/cocos2d_lua_static/__/auto/lu
a_cocos2dx_physics3d_auto.o] Error 1
make: *** Waiting for unfinished jobs…
-
Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. -
Get more help at https://help.gradle.org
BUILD FAILED in 1m 52s
51 actionable tasks: 51 executed
执行命令出错,返回值:1。
用android studio打开之后 直接debug也是包同样的错误