Start cocos2dx 3.8 project with framework

Hi I have downloaded cocos for mac with framework and I tryed to start a new project. I ised cocos command line tool and generated the project. I tryed to compile using build_native but some error occours.
ccp-tests compiles well.

Here is my bash_profile:

# Add environment variable COCOS_CONSOLE_ROOT for cocos2d-x
export COCOS_CONSOLE_ROOT=/Applications/Cocos/frameworks/cocos2d-x-3.8/tools/cocos2d-console/bin
export PATH=$COCOS_CONSOLE_ROOT:$PATH

# Add environment variable COCOS_TEMPLATES_ROOT for cocos2d-x
export COCOS_TEMPLATES_ROOT=/librerieGiochi/cocos2d-x-3.5/templates
export PATH=$COCOS_TEMPLATES_ROOT:$PATH

# Add environment variable NDK_ROOT for cocos2d-x
export NDK_ROOT=/librerieGiochi/android-ndk-r9d
export PATH=$NDK_ROOT:$PATH

# Add environment variable ANDROID_SDK_ROOT for cocos2d-x
export ANDROID_SDK_ROOT=/librerieGiochi/android-sdk-macosx
export PATH=$ANDROID_SDK_ROOT:$PATH
export PATH=$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH

# Add environment variable ANT_ROOT for cocos2d-x
export ANT_ROOT=/Applications/Cocos/tools/ant/bin
export PATH=$ANT_ROOT:$PATH

# Add environment variable COCOS_FRAMEWORKS for cocos2d-x
export COCOS_FRAMEWORKS=/Applications/Cocos/frameworks
export PATH=$COCOS_FRAMEWORKS:$PATH

and this is the errors:

MacBook-Pro-di-Sephiroth:proj.android noidue$ python ./build_native.py
Please use cocos console instead.

Running command: compile
Building mode: debug
Using Eclipse project : /progetti/TestMyGame/TestMyGame/proj.android
Android platform not specified, searching a default one...
running: '/librerieGiochi/android-sdk-macosx/tools/android update project -t android-10 -p /progetti/TestMyGame/TestMyGame/proj.android'

Updated project.properties
Updated local.properties
Updated file /progetti/TestMyGame/TestMyGame/proj.android/proguard-project.txt
It seems that there are sub-projects. If you want to update them
please use the --subprojects parameter.
Building native...
NDK build mode: debug
NDK_TOOLCHAIN_VERSION: 4.8
running: '/librerieGiochi/android-ndk-r9d/ndk-build -C /progetti/TestMyGame/TestMyGame/proj.android -j8 NDK_MODULE_PATH=/Applications/Cocos/frameworks/cocos2d-x-3.8:/Applications/Cocos/frameworks/cocos2d-x-3.8/cocos:/Applications/Cocos/frameworks/cocos2d-x-3.8/external NDK_TOOLCHAIN_VERSION=4.8 NDK_DEBUG=1'

make: Entering directory `/progetti/TestMyGame/TestMyGame/proj.android'
[armeabi] StaticLibrary  : libcpufeatures.a
[armeabi] Gdbserver      : [arm-linux-androideabi-4.8] libs/armeabi/gdbserver
[armeabi] Gdbsetup       : libs/armeabi/gdb.setup
[armeabi] SharedLibrary  : libcocos2dcpp.so
/Applications/Cocos/frameworks/cocos2d-x-3.8/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCActionNode.o):function std::vector<cocos2d::Vector<cocostudio::ActionFrame*>*, std::allocator<cocos2d::Vector<cocostudio::ActionFrame*>*> >::at(unsigned int): error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
/Applications/Cocos/frameworks/cocos2d-x-3.8/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*, ...)'
/Applications/Cocos/frameworks/cocos2d-x-3.8/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCArmature.o):function cocostudio::Armature::init(std::string const&): error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
/Applications/Cocos/frameworks/cocos2d-x-3.8/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCArmatureAnimation.o):function std::vector<std::string, std::allocator<std::string> >::_M_range_check(unsigned int) const: error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
collect2: error: ld returned 1 exit status
make: *** [obj/local/armeabi/libcocos2dcpp.so] Error 1
make: Leaving directory `/progetti/TestMyGame/TestMyGame/proj.android'
Error running command, return code: 2.
Traceback (most recent call last):
  File "./build_native.py", line 43, in <module>
    build(opts.build_mode)
  File "./build_native.py", line 28, in build
    raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!")
Exception: Build dynamic library for project [ /progetti/TestMyGame/TestMyGame/proj.android/../ ] fails!

can You give a hint?
thanks

You don’t need build-native

Just do: cocos compile -p android

and/or: cocos run -p android

We have a chapter in the Programmers Guide about this tool.

thanks for reply, I used the command but error occours:

Last login: Fri Oct 23 11:18:58 on console
MacBook-Pro-di-Sephiroth:~ noidue$ cd /progetti/TestMyGame/TestMyGame/proj.android 
MacBook-Pro-di-Sephiroth:proj.android noidue$ cocos compile -p android
Running command: compile
Building mode: debug
Using Eclipse project : /progetti/TestMyGame/TestMyGame/proj.android
Android platform not specified, searching a default one...
running: '/librerieGiochi/android-sdk-macosx/tools/android update project -t android-10 -p /progetti/TestMyGame/TestMyGame/proj.android'

Updated project.properties
Updated local.properties
Updated file /progetti/TestMyGame/TestMyGame/proj.android/proguard-project.txt
It seems that there are sub-projects. If you want to update them
please use the --subprojects parameter.
Building native...
NDK build mode: debug
NDK_TOOLCHAIN_VERSION: 4.8
running: '/librerieGiochi/android-ndk-r9d/ndk-build -C /progetti/TestMyGame/TestMyGame/proj.android -j8 NDK_MODULE_PATH=/Applications/Cocos/frameworks/cocos2d-x-3.8:/Applications/Cocos/frameworks/cocos2d-x-3.8/cocos:/Applications/Cocos/frameworks/cocos2d-x-3.8/external NDK_TOOLCHAIN_VERSION=4.8 NDK_DEBUG=1'

make: Entering directory `/progetti/TestMyGame/TestMyGame/proj.android'
[armeabi] StaticLibrary  : libcpufeatures.a
[armeabi] Gdbserver      : [arm-linux-androideabi-4.8] libs/armeabi/gdbserver
[armeabi] Gdbsetup       : libs/armeabi/gdb.setup
[armeabi] SharedLibrary  : libcocos2dcpp.so
/Applications/Cocos/frameworks/cocos2d-x-3.8/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCActionNode.o):function std::vector<cocos2d::Vector<cocostudio::ActionFrame*>*, std::allocator<cocos2d::Vector<cocostudio::ActionFrame*>*> >::at(unsigned int): error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
/Applications/Cocos/frameworks/cocos2d-x-3.8/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*, ...)'
/Applications/Cocos/frameworks/cocos2d-x-3.8/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCArmature.o):function cocostudio::Armature::init(std::string const&): error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
/Applications/Cocos/frameworks/cocos2d-x-3.8/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCArmatureAnimation.o):function std::vector<std::string, std::allocator<std::string> >::_M_range_check(unsigned int) const: error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
collect2: error: ld returned 1 exit status
make: *** [obj/local/armeabi/libcocos2dcpp.so] Error 1
make: Leaving directory `/progetti/TestMyGame/TestMyGame/proj.android'
Error running command, return code: 2.

I found that I MUST update ndk to the latest version or at least version 10c. (I had r9c).
But I have now a problem with eclipse…
I don’t know how to tell…seems that compile but I have only warnings liks:

Description    Resource    Path    Location    Type
Invalid project path: Include path not found (/progetti/TestMyGame/TestMyGame/cocos2d/cocos/2d).    TestMyGame        pathentry    Path Entry Problem

and not run or not see anything in consolle…
I don’t know how provide further information to solve the problem…
any updated tutorial on how to start a fresh project with the latest version of cocos2dx?
I have seen this:
http://www.cocos2d-x.org/wiki/How_to_Build_an_Android_Project_with_Eclipse
but in the step:

Import Libcocos2dx Project

This is more or less the same process as we do in the previous section except for the path of the proj.android is different.

The path of the libcocos2dx project is [your own game project folder]/cocos/2d/platform/android/java. 

I have no folder with that path

[your own game project folder]/cocos/2d/platform/android/java. 

thanks