Cocos Creator Android Compiling Error

Hi,

I have been encountering issues with Cocos Creator’s project compilation for Android, but I wasn’t able to solve it so I was hoping if anyone could hint to me something I should know…

Reading some of the post by other people, I’ve tried

setting system environment
=> ANT_ROOT, ANDROID_SDK_ROOT, NDK_ROOT, JAVA_HOME
changing NDK versions
=> r9d, r10d, r10e
changing API level
=> 10, 19

I’m using
Cocos Creator v1.5.1
Apache ANT 1.9.4
Python 2.7

Using a helloworld template, compiling the project give me this error

...
[arm64-v8a] StaticLibrary  : libcocos2d.a
[arm64-v8a] StaticLibrary  : libcocosbuilder.a
[arm64-v8a] StaticLibrary  : libspine.a
[arm64-v8a] StaticLibrary  : libnetwork.a
[arm64-v8a] StaticLibrary  : libvorbisidec.a
[arm64-v8a] StaticLibrary  : libpvmp3dec.a
[arm64-v8a] StaticLibrary  : libcpufeatures.a
[armeabi] SharedLibrary  : libcocos2djs.so
arm-linux-androideabi-g++: error: C:UsersKDesktopProjecttestbuildjsb-defaultframeworkscocos2d-xexternal/android/armeabi/libPluginProtocolStatic.a: No such file or directory
arm-linux-androideabi-g++: error: C:UsersKDesktopProjecttestbuildjsb-defaultframeworkscocos2d-xexternal/android/armeabi/libjs_static.a: No such file or directory
arm-linux-androideabi-g++: error: C:UsersKDesktopProjecttestbuildjsb-defaultframeworkscocos2d-xexternal/android/armeabi/libwebsockets.a: No such file or directory
arm-linux-androideabi-g++: error: C:UsersKDesktopProjecttestbuildjsb-defaultframeworkscocos2d-xexternal/android/armeabi/libssl.a: No such file or directory
arm-linux-androideabi-g++: error: C:UsersKDesktopProjecttestbuildjsb-defaultframeworkscocos2d-xexternal/android/armeabi/libcrypto.a: No such file or directory
arm-linux-androideabi-g++: error: C:UsersKDesktopProjecttestbuildjsb-defaultframeworkscocos2d-xexternal/android/armeabi/libfreetype.a: No such file or directory
arm-linux-androideabi-g++: error: C:UsersKDesktopProjecttestbuildjsb-defaultframeworkscocos2d-xexternal/android/armeabi/libpng.a: No such file or directory
arm-linux-androideabi-g++: error: C:UsersKDesktopProjecttestbuildjsb-defaultframeworkscocos2d-xexternal/android/armeabi/libjpeg.a: No such file or directory
arm-linux-androideabi-g++: error: C:UsersKDesktopProjecttestbuildjsb-defaultframeworkscocos2d-xexternal/android/armeabi/libtiff.a: No such file or directory
arm-linux-androideabi-g++: error: C:UsersKDesktopProjecttestbuildjsb-defaultframeworkscocos2d-xexternal/android/armeabi/libwebp.a: No such file or directory
arm-linux-androideabi-g++: error: C:UsersKDesktopProjecttestbuildjsb-defaultframeworkscocos2d-xexternal/android/armeabi/libchipmunk.a: No such file or directory
arm-linux-androideabi-g++: error: C:UsersKDesktopProjecttestbuildjsb-defaultframeworkscocos2d-xexternal/android/armeabi/libz.a: No such file or directory
make.exe: *** [obj/local/armeabi/libcocos2djs.so] Error 1
make.exe: *** Waiting for unfinished jobs....
make.exe: Leaving directory `C:/Users/K/Desktop/Project/test/build/jsb-default/frameworks/runtime-src/proj.android-studio/app'
Error running command, return code: 2.

Another error I received as well

Building mode    : release
Using Eclipse project : C:\Users\K\Desktop\Project\project\build\jsb-default\frameworks\runtime-src\proj.android
running: '"C:\Android\sdk\tools\android" update project -t android-10 -p C:\Users\K\Desktop\Project\project\build\jsb-default\frameworks\runtime-src\proj.android'

Updated project.properties
Updated local.properties
Updated file C:\Users\K\Desktop\Project\project\build\jsb-default\frameworks\runtime-src\proj.android\proguard-project.txt
running: '"C:\Android\sdk\tools\android" update lib-project -p C:\Users\K\Desktop\Project\project\build\jsb-default\frameworks\cocos2d-x\cocos\platform\android\java -t android-10'

Updated project.properties
Updated local.properties
Updated file C:\Users\K\Desktop\Project\project\build\jsb-default\frameworks\cocos2d-x\cocos\platform\android\java\proguard-project.txt
Building native...
NDK build mode: release
NDK_TOOLCHAIN_VERSION: 4.9
running: '"C:\Android\android-ndk-r10d\ndk-build" -C C:\Users\K\Desktop\Project\project\build\jsb-default\frameworks\runtime-src\proj.android -j4 APP_ABI="armeabi armeabi-v7a x86 arm64-v8a" NDK_MODULE_PATH=C:\Users\K\Desktop\Project\project\build\jsb-default\frameworks\cocos2d-x;C:\Users\K\Desktop\Project\project\build\jsb-default\frameworks\cocos2d-x\cocos;C:\Users\K\Desktop\Project\project\build\jsb-default\frameworks\cocos2d-x\external NDK_TOOLCHAIN_VERSION=4.9'

make.exe: Entering directory `C:/Users/K/Desktop/Project/project/build/jsb-default/frameworks/runtime-src/proj.android'
make.exe: *** No rule to make target `C:\Project\project\build\jsb-default\frameworks\cocos2d-x\cocos/scripting/js-bindings/proj.android/../auto/jsb_cocos2dx_extension_auto.cpp', needed by `obj/local/armeabi/objs/cocos2d_js_static/__/auto/jsb_cocos2dx_extension_auto.o'.  Stop.
make.exe: *** Waiting for unfinished jobs....
make.exe: Leaving directory `C:/Users/K/Desktop/Project/project/build/jsb-default/frameworks/runtime-src/proj.android'
Error running command, return code: 2.

Any help will be appreciated. Thank you

Hi,

Did you enable ProGuard for your Android project?

Anyone have a solution? Please help :frowning:

I notice the English forum for cocos2d isn’t very lively,
I dare say majority of the issue post is solved by the poster themselves…

What errors did you encounter when you compile?
Perhaps I can give you some assistance

Thank you, I downloaded new NDK and it worked now :smiley: