I can't compile cocos2d-x 3.15 Lua with cocos command. And with Android Studio 2.3 , either


I can’t compile cocos2d-x 3.15 Lua with cocos command. And with Android Studio 2.3 , either.

Windows 10
Android NDK r14b
cocos2d-x 3.15 Lua

cocos new sandbox-cocos2d-x_3.15 -p org.example.cocos -l lua
cd sandbox-cocos2d-x_3.15
cocos compile -p android --android-studio

[armeabi] Compile++ arm : bullet_static <= SpuGatheringCollisionDispatcher.cpp
[armeabi] Compile++ arm : bullet_static <= SpuLibspe2Support.cpp
[armeabi] Compile++ arm : bullet_static <= SpuSampleTaskProcess.cpp
[armeabi] Compile++ arm : bullet_static <= boxBoxDistance.cpp
[armeabi] Compile++ arm : bullet_static <= SpuCollisionShapes.cpp
[armeabi] Compile++ arm : bullet_static <= SpuContactResult.cpp
[armeabi] Compile++ arm : bullet_static <= SpuGatheringCollisionTask.cpp
[armeabi] Compile++ arm : bullet_static <= SpuMinkowskiPenetrationDepthSolver.cpp
[armeabi] Compile++ arm : bullet_static <= SpuSampleTask.cpp
[armeabi] Compile++ arm : bullet_static <= btAlignedAllocator.cpp
C:/cocos/sandbox-cocos2d-x_3.15/frameworks/cocos2d-x/external/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp:344:1: fatal error: opening dependency file C:/cocos/sandbox-cocos2d-x_3.15/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/armeabi/objs-debug/bullet_static/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.o.d: No such file or directory
compilation terminated.
make: *** [C:/cocos/sandbox-cocos2d-x_3.15/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/armeabi/objs-debug/bullet_static/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.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.


Is there anyone with a similar problem?

Another I can compiled cocos2d-x 3.15 cpp with cocos command.


It seems the path is too long to exceed the limitation on windows. You can create the project under the root of C: to have a try, and make the project name a little short. Android Studio can configure the path of output, i haven’t tried it. I will try to redirect the output and modify the template if it works.


Thank you.
The problem was exactly as you said. I have solved the problem.