Cocos2d Android environment, cocos2dandroid

Source: Internet
Author: User

Cocos2d Android environment, cocos2dandroid

1. Before starting, prepare the following resources. If the android development environment has been installed with 3rd or 4.

1. Click to download JDK (1.6)

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

3. Click to download the NDK.

4. CYGWIN click to download 2. environment variables (not all of them are used. Make a flag here)
-------------------- JAVA environment variable setting --------------------------------------
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


--------------------------- 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 HelloWord project, click to view official tutorials, and the steps after import are as follows. 3. The packages to be downloaded for cygwin ndk (which must be installed in the installation process): autoconf2.1, automake1.10, binutils, gcc-core, Gcc- G ++Gcc4-core, gcc4-g ++, gdb, pcre, pcre-devel, gawk, Make    Check whether the installation is successful. Open cygwin. bat and enter cygcheck-c cygwin gcc -- version g ++ -- version make -- version. If the information is displayed, the installation is successful.
  • [Possible problems]If CYGWIN does not generate a folder for the user of the current system under/home/, You need to delete the environment variable HOME and run it again.
  • In the/home generated folder, find. bash_profile and add the following NDK path
NDK_ROOT =/cygdrive/D/installation package/software development/Android/NDK/android-ndk-r10dexport NDK_ROOT

 

  • Enter the/cygdrive/file path to access the files on your local hard drive, as shown above.
4. Set the compiling environment for ADT. Create a compiling environment.
Follow the steps below to complete the CYGWIN compiling environment. Note: $ NDK_ROOTIt was set in. bash_profile. & Add $ NDK_ROOT later. Otherwise, this command cannot be found. Select the directory where the JNI of the current project is located. Finally, save and clear the project (Clean. 5, [Possible problems]Compile Change the library name of. so to the corresponding name.And then compile it again. Otherwise, an error will be reported


6, [Possible problems]Copy the resource file (../Resources) to the asserts directory. The Fatal signal 11 (SIGSEGV) at 0x00000000 NULL pointer error is reported because the resource file cannot be found.
After many twists and turns, the first compilation. so library is very slow. Final running effect:

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.