Cocos2d-x win7 run through Android engineering steps (solution @ drawable/icon)

Source: Internet
Author: User
I. Official download cocos2d-2.1beta3-x-2.1.1.rar, unzip, such as cocos2d-2.1beta3-x-2.1.1/

II.

Unzip the folder to see if the cocos2d-2.1beta3-x-2.1.1 owner is the current user, and whether the operation permissions can be read and written.

If not, use either of the following methods

Method 1 (recommended ).


Owner changeProperty-> Security-> advanced-> ower-> edit-> OK

Permission change Property-> Security-> edit-> (everyone or your account) full control-> OK

Method 2.

After the Administrator runs cygwin:
 Owner change Chown-r current user name *
 Permission change Chmod-r 666 *

Method 3.

CMD
Owner changeTakeown
/F/R folder

 Permission changeIcacls why/T/grant Bob :( F)

 


To adapt to my configuration environment, I made some changes in the create-android-project.bat.

? Set_cygbin = c: \ cygwin \ bin

Cygwin bin path

? Set_androidtools = D: \ Android-SDK-Windows \ tools

Android SDK tools path

? Set_ndkroot = D: \ Android \ android-ndk-r5b

Root directory of ndk


(If ndk_root is still reported to be undefined in the future, try to enter the % cygwin %/home/your account/directory.

Add the following two sentences to the end of. bash_profile and restart cygwin.

 Ndk_root =/cygdrive/C/work/android-ndk-r8d

Export ndk_root)

3.

(Note: The following operations are performed in cmd. If Windows 7 is used, run it with administrator. Otherwise, the. Java file may be empty due to permission issues)


Enter the root directory of the cocos2d-x, run the create-android-project.bat, enter the name of the project (such as XXX), and target ID

4.

(Note: The following operations are performed in cygwin. If Windows 7 is used, run the command as administrator. Otherwise, permission issues may occur)

Go to the generated XXX project folder and enter the proj. Android directory.

Cd c:

CD/x/y/z/xxxx/proj. Android

./Build_native.sh


If cc1plus.exe: Fatal error: JNI/hellocpp/Main. cpp: Permission denied

Run

 Chmod-r 666 JNI /*

And then execute

./Build_native.sh


If you encounter sharedlibrary: Libgame. So

C:/work/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/Windows/Bi N/../lib/GCC/ARM-Linux-androideabi/4.6/.../ARM-Linux-androideabi/bin/lD.
 EXE:
Error: cannot open./obj/local/armeabi/PNG. A: Permission denied

And a large batch of errors, Please execute

 Chmod-r 666 OBJ /*

 And then execute

 ./Build_native.sh

 


4. Open eclipse and introduce XXX as a project.


Modify some minor issues such:

A. the Java version is incorrect. Method 1: andorid tools-> fix project propertMethod 2: Property-> Java compiler-> compiler compliance level 1.6

B. @ drawable/icon-> @ drawable/ic_launcher in androidmanifest. xml


You also need to introduce the libcocos2dx library project, or the cocos2dxactivity cannot be found.

Library engineering location cocos2d-x-2.1.1 \ cocos2dx \ platform \ Android \ Java

 

V,

Connect to the android real machine,Right-click Project-run as AndroidTo see the little robot.

 

Sat.

If fatalError: Main is reported during running In eclipse, go to the corresponding project-> properties-> JAVA build path-> order and export Add libcocos2dx. jar, restart eclipse, and run as Android Application

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.