Complete the COCOS2DX steps to build an Android APK file

Source: Internet
Author: User

First send a picture to show my operation step result diagram (real machine show)

First of all, the software that needs to be prepared (assuming you have a Java environment) is a way to

1.ADT Downloads

2.NDK download need to configure environment variable Ndk_root value for NDK location

3.MinGW (for running SH script)


I'll let you fully configure the Java environment and the NDK environment first. The environment is not discussed here, otherwise there are a lot of things to say.

After creating a COCOS2DX project, open the MinGW to enter the proj of the project. Android folder

then enter the./build_native.sh run. (Hint: Do not modify the project C + + source code, because the project will be modified a lot, follow-up only detailed explanation)

The interface is as follows (the following interface has less information pop-up because the project has done this step)


Then open the ADT Import project






Then click Next, Next.

When loading is complete, review Hellocpp.java found errors (of course, I have modified the following, no error display)

Workaround: Copy (address whichever is your) E:\cocos2d-x-2.2.1\cocos2dx\platform\android\java\src under the Org folder to

E:\COCOS2D-X-2.2.1\PROJECTS\2048_BOJIE\PROJ.ANDROID\SRC under

Then refresh ADT



found that the error has not been, there may be some people's project, there will be a mistake, is the package error.

is the first line of the picture below, modify the package name according to the ADT hint


Then, this time, ADT will help you build the APK under the \bin\res file, but this apk is not started properly after installation.

Why???

Because we have just modified the package, in the XML file is not modified, right-click Open Androidmainfeast.xml

Change the package to the name of the packet you just modified.


This way, the re-refresh, running on the virtual machine, can be opened normally.

Have time to follow .....



Complete the COCOS2DX steps to build an Android APK file

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.