Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocos2d-x android can't resolved coscos2dx library

i am starting by macOSX xcode4.5 .
i tried to tutorials.

Using cocos2dx, it completes building of macOSX,
The problem occurred in android sources.

No contents of cocos2dxActivity are described.
so, org.cocos2dx.lib is not other files.

android is not running.

i use ndk-r8. What will be a problem?

like image 912
user1708211 Avatar asked Sep 29 '12 15:09

user1708211


3 Answers

In cocos2d-x 2.0.3 ...Cocos2d-x Lib java files has been considered as a different project only So import that project in the eclipse

Lets make it Simple

  1. First Import the project in eclipse from this path - cocos2d-2.0-x-2.0.3/cocos2dx/platform/android/java

You will see libcocos2dx project in eclipse ...Keep this project open always otherwise your projects will give error on the syntax of library

  1. Run create-android-project

  2. Now Import the project which you have created and just Run (If you know the concept of isLibrary then that's how they are maintaining it now ..)

Also additional information to run build-native.sh from eclipse only , Right Click Project ->C/C++ Build Uncheck Use Default Build COmmand and add following bash ${workspace_loc:/YourProjName}/build_native.sh NDK_DEBUG=1 V=1

Good Luck ..If any question please feel free to ask

like image 197
user1169079 Avatar answered Nov 06 '22 08:11

user1169079


Change

import org.cocos2dx.lib.Cocos2dxActivity;

to

import android.app.Activity;

and change

extends Cocos2dxActivity

to

extends Activity
like image 37
Ignacio Gómez Avatar answered Nov 06 '22 08:11

Ignacio Gómez


You can copy the folder (cocos2d-2.0-x-2.0.3/cocos2dx/platform/android/java) beside the proj.android folder of your game folder, then import it with the game in eclipse.After importing these 2 projects, open Properties of the game and then add libcocos2dx as library and click apply and build.

i have tries these and works for me

like image 2
Hossam Ghareeb Avatar answered Nov 06 '22 07:11

Hossam Ghareeb