Record the process of making cocos2d-x Android APK package

Source: Internet
Author: User

Reprinted Please note: http://blog.csdn.net/herm_lib/article/details/8644340

1. Download several necessary software first

[1] jdk-7u17-windows-x64

[2] Android SDK, adt-bundle-windows-x86_64-20130219

I downloaded this file with eclipse.

Android ndk, android-ndk-r8d-windows

[4] cygwin

Install g ++, make, and so on.

2. Set the environment variable ndk_root

Specify ndk_root to the android-ndk-r8d-windows.

3. Modify the create-android-project.bat under the cocos2dx directory

[1] Add:

CD/d % ~ Dp0

[2] modifying paths such as cygwin

4. Run create-android-project.bat as Administrator

Specify the package and project name. A new project is generated under cocos2dx.

5. Start cygwin as an administrator and run proj_name/proj. Android/build_native.sh

An error is reported. For example, JNI/hellocpp/Main. cpp: Permission denied.

I don't know why the entire directory cannot be changed because of modifying the permissions of these files !? I made changes one by one.

If C ++ 11 is used, an error is reported, indicating that STD: mutex, STD: thread cannot be found. In application. mk, add:

App_cppflags: =...-STD = C ++ 11

Ndk_toolchain_version = 4.7 # This must be added ....

I don't know why. I added this on the Mac machine, but the compilation still reported the error. In Windows + cygwin, it was okay... It's too tough.

6. Start eclipse

File-> project...-> Android project from existing code

Export the project just now.

7. Build-> RUN

This step may cause some errors.

Do the following two things:

[1] convertCodeCopy to: helloworld \ proj. Android \ SRC

[2] androidmanifest. XML,

<Application Android: Label = "@ string/app_name" Android: icon = "@ drawable/icon">

<Application Android: Label = "@ string/app_name" Android: icon = "@ drawable/ic_launcher">

After successful, the APK will be generated under proj. Android \ bin.

This production process is absolutely too troublesome. In 2003, Windows CE, developed by Visual Studio, created the maxcompute installation package,

You only need a wizard to create a project. It is much easier to compile a Symbian package as long as the next SDK is used.

Related Article

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.