Cocos Console Compile Error on Android
Cocos Console-
efaresLikes 0Problem Description
I was following the Cocos Console tutorial and made a new project in JavaScript. When I tried to compile the newly created project I ran into an error.
I tried searching online for solutions but was not able to find anything, please help.I am using:
Mac
Cocos2d-x v3.7 (JavaScript)
Android NDK r9d
SDK for Mac (downloaded without Eclipse)
Apache Ant 1.9.5-----------------------------------------------------------------------------------------------
AirEli:CLIproject eliasfares$ cocos compile -p android
Running command: compile
Building mode: debug
Using Eclipse project : /Users/eliasfares/Cocos2d/CLIproject/frameworks/runtime-src/proj.android
Android platform not specified, searching a default one...
running: '/Users/eliasfares/Cocos2d/Android/android-sdk-macosx/tools/android update project -t android-22 -p /Users/eliasfares/Cocos2d/CLIproject/frameworks/runtime-src/proj.android'Updated project.properties
Updated local.properties
Updated file /Users/eliasfares/Cocos2d/CLIproject/frameworks/runtime-src/proj.android/proguard-project.txt
Building native...
NDK build mode: debug
NDK_TOOLCHAIN_VERSION: 4.8
running: '/Users/eliasfares/Cocos2d/Android/android-ndk-r9d/ndk-build -C /Users/eliasfares/Cocos2d/CLIproject/frameworks/runtime-src/proj.android -j4 NDK_MODULE_PATH=/Applications/Cocos/frameworks/cocos2d-x-3.7:/Applications/Cocos/frameworks/cocos2d-x-3.7/cocos:/Applications/Cocos/frameworks/cocos2d-x-3.7/external NDK_TOOLCHAIN_VERSION=4.8 NDK_DEBUG=1'make: Entering directory `/Users/eliasfares/Cocos2d/CLIproject/frameworks/runtime-src/proj.android'
[armeabi] StaticLibrary : libcpufeatures.a
[armeabi] Gdbserver : [arm-linux-androideabi-4.8] libs/armeabi/gdbserver
[armeabi] Gdbsetup : libs/armeabi/gdb.setup
[armeabi] SharedLibrary : libcocos2djs.so
/Applications/Cocos/frameworks/cocos2d-x-3.7/cocos/scripting/js-bindings/proj.android/prebuilt-mk/../../../../../prebuilt/android/armeabi/libjscocos2dandroid.a(CCJavascriptJavaBridge.o):function JavascriptJavaBridge::CallInfo::checkType(std::string const&, unsigned int*): error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
/Applications/Cocos/frameworks/cocos2d-x-3.7/cocos/scripting/js-bindings/proj.android/prebuilt-mk/../../../../../prebuilt/android/armeabi/libjscocos2dandroid.a(CCJavascriptJavaBridge.o):function JavascriptJavaBridge::callStaticMethod(JSContext*, unsigned int, JS::Value*): error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
/Applications/Cocos/frameworks/cocos2d-x-3.7/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCActionNode.o):function std::vector*, std::allocator*> >::at(unsigned int): error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
/Applications/Cocos/frameworks/cocos2d-x-3.7/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCArmature.o):function cocostudio::Armature::drawContour(): error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
collect2: error: ld returned 1 exit status
make: *** [obj/local/armeabi/libcocos2djs.so] Error 1
make: Leaving directory `/Users/eliasfares/Cocos2d/CLIproject/frameworks/runtime-src/proj.android'
Error running command, return code: 2.
AirEli:CLIproject eliasfares$
-
Sonar Systems adminLikes 0
Could you send us a screenshot of the problem.
This reply has been verified.
-
efaresLikes 0
I just sent an email to support@sonarsystems.co.uk with the screenshot of the terminal output. Did you need any other log/info of the problem?
-
efaresLikes 0
I got it working!
I was using Android NDK r9d like the tutorial suggested (with Cocos2d v3.7 framework) but when I upgraded to Android NDK r10e it worked like a charm!
Also, I was using apache ant that came with Cocos v2.3.1. It did not work/compile when I used a seperatly downloaded version of ANT.:)
-
Sonar Systems adminLikes 0
Great to hear :D
This reply has been verified.
Login to reply