Cocos Creator Compile Error

Hi,
When I build game, there is no problem. But after clicking compile(for android) button there is an error. (Mac OS X El Capitan)

Here is the error:

native.log :

Building mode: release
Updated project.properties
Updated local.properties
Updated file /Users/macbook/Desktop/CocosProjeler/Deneme/build/jsb-default/frameworks/runtime-src/proj.android/proguard-project.txt
Updated project.properties
Updated local.properties
Updated file /Users/macbook/Desktop/CocosProjeler/Deneme/build/jsb-default/frameworks/cocos2d-x/cocos/platform/android/java/proguard-project.txt
Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml
Android NDK: WARNING: Unsupported source file extensions in /Users/macbook/Desktop/CocosProjeler/Deneme/build/jsb-default/frameworks/runtime-src/proj.android/ā€¦/ā€¦/cocos2d-x/cocos/scripting/js-bindings/proj.android/Android.mk for module cocos2d_js_static
Android NDK: \
[armeabi-v7a] Compile++ : cocos2djs_shared <= main.cpp
make: /Users/macbook/Library/Android/ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++: No such file or directory
[armeabi-v7a] Compile++ : cocos2djs_shared <= AppDelegate.cpp
make: /Users/macbook/Library/Android/ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++: No such file or directory
make: *** [obj/local/armeabi-v7a/objs/cocos2djs_shared/hellojavascript/main.o] Error 1
make: *** Waiting for unfinished jobsā€¦
make: *** [obj/local/armeabi-v7a/objs/cocos2djs_shared///Classes/AppDelegate.o] Error 1
Using Eclipse project : /Users/macbook/Desktop/CocosProjeler/Deneme/build/jsb-default/frameworks/runtime-src/proj.android
Android platform not specified, searching a default oneā€¦
running: ā€˜/Users/macbook/Library/Android/sdk/tools/android update project -t android-19 -p /Users/macbook/Desktop/CocosProjeler/Deneme/build/jsb-default/frameworks/runtime-src/proj.androidā€™

Android platform not specified, searching a default oneā€¦
running: ā€˜/Users/macbook/Library/Android/sdk/tools/android update lib-project -p /Users/macbook/Desktop/CocosProjeler/Deneme/build/jsb-default/frameworks/cocos2d-x/cocos/platform/android/java -t android-19ā€™

Building nativeā€¦
NDK build mode: release
Parse NDK version from file /Users/macbook/Library/Android/ndk/RELEASE.TXT failed.
NDK_TOOLCHAIN_VERSION: 4.8
running: ā€˜/Users/macbook/Library/Android/ndk/ndk-build -C /Users/macbook/Desktop/CocosProjeler/Deneme/build/jsb-default/frameworks/runtime-src/proj.android -j4 NDK_MODULE_PATH=/Users/macbook/Desktop/CocosProjeler/Deneme/build/jsb-default/frameworks/runtime-src/proj.android/ā€¦/ā€¦/cocos2d-x:/Users/macbook/Desktop/CocosProjeler/Deneme/build/jsb-default/frameworks/runtime-src/proj.android/ā€¦/ā€¦/cocos2d-x/cocos:/Users/macbook/Desktop/CocosProjeler/Deneme/build/jsb-default/frameworks/runtime-src/proj.android/ā€¦/ā€¦/cocos2d-x/external NDK_TOOLCHAIN_VERSION=4.8ā€™

Error running command, return code: 2.

how can I solve this problem?

Please recheck your Android NDK, it may not be correctly installed or its version maybe not compatible, Iā€™m using r10c, but arm-linux-androideabi-4.8 toolchain may be absent in r10e

I couldnt find old versions of ndk. My version is r11c. Where I can find r10c version?

I found a r9d link: https://dl.google.com/android/ndk/android-ndk-r9d-darwin-x86_64.tar.bz2

I will format my pc. If again it gives error, i will try r9d. thanks for helps.

Iā€™m almost sure that r11c wonā€™t work, it only contains newer toolchain than 4.8

I formatted my pc and reinstall everything for Cocos Creator (^^).

But there is an error I think it is simple but I dont know how can I fixt it.

Building mode: release
Using Eclipse project : /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android
Android platform not specified, searching a default oneā€¦
Canā€™t find right Android-platform for project : ā€˜/Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.androidā€™. The Android-platform should be equal/larger than 10.

Seems it havenā€™t found the Android SDK, can you specify it in Creatorā€™s preference panel?

Hi,
I dont understand why happened it.
This is preferences window:

This is also SDK path

@ozergul can you try this in your terminal:

>echo $ANDROID_SDK_ROOT 

@jyinkailej please take a look at this

Hello, there is nothing as answer in terminal

I run this command at terminal

export ANDROID_SDK_ROOT=ā€™/Users/ozergul/Library/Android/sdkā€™

export PATH=$PATH:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/tools/lib/x86_64

And now SDK path is shown when I write echo $ANDROID_SDK_ROOT

Now I click Compile button and there are errorsā€¦

Building mode: release
Updated project.properties
Updated local.properties
Updated file /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android/proguard-project.txt
Updated project.properties
Updated local.properties
Updated file /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/cocos2d-x/cocos/platform/android/java/proguard-project.txt
Android NDK: WARNING: APP_PLATFORM android-21 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml
Android NDK: WARNING: Unsupported source file extensions in /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android/ā€¦/ā€¦/cocos2d-x/cocos/scripting/js-bindings/proj.android/Android.mk for module cocos2d_js_static
Android NDK: \
[armeabi-v7a] StaticLibrary : libcocos2d.a
make: /Users/ozergul/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc-ar: No such file or directory
make: *** [obj/local/armeabi-v7a/libcocos2d.a] Error 1
make: *** Waiting for unfinished jobsā€¦
Using Eclipse project : /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android
Android platform not specified, searching a default oneā€¦
running: ā€˜/Users/ozergul/Library/Android/sdk/tools/android update project -t android-21 -p /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.androidā€™

Android platform not specified, searching a default oneā€¦
running: ā€˜/Users/ozergul/Library/Android/sdk/tools/android update lib-project -p /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/cocos2d-x/cocos/platform/android/java -t android-21ā€™

Building nativeā€¦
NDK build mode: release
Parse NDK version from file /Users/ozergul/Library/Android/sdk/ndk-bundle/RELEASE.TXT failed.
NDK_TOOLCHAIN_VERSION: 4.8
running: ā€˜/Users/ozergul/Library/Android/sdk/ndk-bundle/ndk-build -C /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android -j4 NDK_MODULE_PATH=/Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android/ā€¦/ā€¦/cocos2d-x:/Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android/ā€¦/ā€¦/cocos2d-x/cocos:/Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android/ā€¦/ā€¦/cocos2d-x/external NDK_TOOLCHAIN_VERSION=4.8ā€™

Error running command, return code: 2.

I compiled with android-ndk-r9dā€¦ Thanks for answers.

It seems there is still something wrong with the preference settings, I will report it as a bug, thanks !

1 Like

Try moving ant and anything else on your desktop that cc needs, to somewhere in program files or C:. IE; your storage root. Caused problems for me before. All kinds of stuff. Idk why. And IDC because doing this solved many problems for me. May be irrelevant in this case but figured it was worth a mention. Especially since no one could figure it out and I just got lucky by remembering I had never actually put dev stuff on my desktop before. - On mobile. Forgive the haqed post.

android-ndk-r9d will not work, please try r10e

Creator 1.x will pass build environments to cocos console directly, so it will not depend on system environment.

If you move something after the environment variables/paths(correct term?) were set; it could, right? I just thought of that and I assume now that my problem came from this since I had put everything back where it was in the end and that was all it took. :slight_smile: silly me messing with things I donā€™t understand. Iā€™ll never learn that lessonā€¦thank goodness. Anywomp; thanks. Back to the loony bin for me. Edit: was prolly on .7v back then in my case. Man Iā€™m tiredā€¦

Following worked for me on Windows 10 64-bit:
while compiling the android project with cocos2d:
ā€œcocos compile -p android --android-studioā€
the above command produced following error ā€œā€¦Android platform not specified, searching a default oneā€¦ā€ as also mentioned in the above links.

which I resolved with procedure at following link:

http://cocos2d-x.org/docs/installation/B/index.html

Android-studio 2.1.
Other setting as mentioned in the above link.

if the build fail because something like ā€œbuild-tools 22.0.1ā€ not found, then refer following link:

I hope that helps you, if you land hereā€¦ :smile: