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