COCOS2D Android Environment Setup

Source: Internet
Author: User

1, before the beginning, you need to prepare the resources as below, if the Android development environment has been directly installed 3rd, 4.

  1. JDK Click to download (1.6)

 2. ADT (already comes with Android SDK) Click to download

 3. NDK Click to download

4, CYGWIN Click to download   2, environment variables (not necessarily all used, do a sign in this)
----------------------The JAVA environment variable settings--------------------------------------
Java_home
C:\Program files\java\jdk1.7.0_17
--------------------------
CLASSPATH
.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;
--------------------------
Path
%java_home%\bin;%java_home%\jre\bin;
--------------------------


---------------------NDK environment variable---------------------------------------
Ndk_root
C:\Program FILES\JAVA\NDK


---------------------------the SDK environment variable-------------------------------
Android_sdk_root
D:\ installation package \ Development Software \android\adt-bundle-windows-x86_64-20130729\sdk0
--------------------------
PATH
;%android_sdk_root%\platform-tools;%android_sdk_root%\platforms;%android_sdk_root%\tools;
--------------------------
4, how to create a new Helloword project, click to view the official tutorial, the following is the steps after the import. 3, CYGWIN NDK need to download the package (installation process reference, the following is required) autoconf2.1, automake1.10, Binutils, Gcc-core, GCC- g++, Gcc4-core, gcc4-g++, GDB, Pcre, Pcre-devel, Gawk, Make    Verify that the installation is successful, open the Cygwin.bat input: cygcheck-c cygwin gcc--version g++--version make--version If the message is displayed, the installation is successful.
    • "Problems that can arise" CYGWIN If you do not generate a folder for the user who corresponds to the current system under/home/, you will need to delete the environment variable home and run it again.
    • found under the folder generated by /home . Bash_profile Add the following NDK path
ndk_root=/cygdrive/d/installation package/development software/android/ndk/android-ndk-r10dexport Ndk_root

    • To access your local hard disk file, enter the/cygdrive/file path as shown above.
 4, ADT set up the compilation environment.  Create a new compilation environment.
       Follow the below to complete the CYGWIN compilation environment, note $NDK _rootIt was set in the previous. Bash_profile.                && later to add $ndk_root otherwise cannot find this command.            Select the directory where the current project JNI resides.  Finally save, clean up the project (clear) complete. 5. "Problems that can arise"Will compile Change the library name of. So to the corresponding name, and then compile it one more time. Otherwise, the operation will be an error.


6. "Problems that can arise"The resource file (.. /resources) was copied to the asserts directory because the resource file could not be found.Fatal Signal (SIGSEGV) at 0x00000000The null pointer error.
After many twists and turns, finally can run, the first compilation. So the library is slow and slow. Last Run Effect:

COCOS2D Android Environment Setup

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.