Cocos2d-x 3.2 Compile Build Android program error solution

Source: Internet
Author: User

Recently upgraded to Cocos2d-x 3.2 official version, the iOS program compiled without any problems, the results using Cocos compile-p Android compiled APK program, the result is tragic, the following error occurred.

Android ndk:invalid App_stl value:c++_static

Android Ndk:please Use one of the following Instead:system stlport_static stlport_static_hard stlport_shared stlport_sh Ared_hard gnustl_static gnustl_shared gabi++_static gabi++_shared libc++_static libc++_shared None

make:entering directory '/game/physics_engine/proj.android '

/sdk/ndk/android-ndk-r9c/build/core/add-application.mk:274: * * * Android ndk:aborting. Stop.

make:leaving directory '/game/physics_engine/proj.android '

Error running command, return Code:2


Obviously, this error is using an incorrect STL Library, the solution has the following two.


Scenario 1: Interim programme


Modify the Application.mk file to replace the original first 4 lines with the following content. And then the replacement is OK.


The original content is as follows:

App_stl: = c++_static
Ndk_toolchain_version=clang

App_cppflags: =-frtti-dcc_enable_chipmunk_integration=1-std=c++11-fsigned-char
App_ldflags: =-latomic


The following contents are replaced:

App_stl: = gnustl_static

App_cppflags: =-frtti-dcocos2d_debug=1-std=c++11-wno-literal-suffix-fsigned-char


Scenario 2:

Since c++_static can only be used in the latest NDK, downloading the latest ndk is possible.


You can download the latest NDK version from http://developer.android.com/tools/sdk/ndk/index.html and then reset the NDK path.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.