Cocos2d-x android can't resolved coscos2dx library - android

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?

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
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
Run create-android-project
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

Change
import org.cocos2dx.lib.Cocos2dxActivity;
to
import android.app.Activity;
and change
extends Cocos2dxActivity
to
extends Activity

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

i figure out by myself..
Using cocos2dx 2.0.3 (2012-09-26),
eclipse source:org.cocos2dx.lib is not created.
(org.cocos2dx.lib is created cocos2dxActivity only.
and cocos2dxActivitiy is no contents described.
cocos2dxActivity:
package org.cocos2dx.lib;
mport android.app.Activity;
public class Cocos2dxActivity extends Activity{
}
)
therefore,
Using cocos2dx 2.0.2 (2012-08-30), eclipse build ok.
i can't understand what is problem...

Related

Android Studio, Sample Code - Not working

There is sample code on the developer site that i wish to run.
When I import as a new Android Studio project, I'm not given any ability to run the code (disabled buttons).
I attempted to copy the source files over into the shell of a new project, but i than got errors that didn't make sense. reference to duplicate declarations in source files that had nothing relating inside them.
Is there an idiots guide on how to properly use android studio, or is it just this difficult?
In order to correctly import the project, you should follow the Samples guide as found in the developer docs.
To import a downloaded project:
Unpack the downloaded project package.
In Android Studio, chose File >
Import Project and select the root folder of the unpacked project.
Android Studio may ask you to choose the type of project you are
importing.
If this is the case, make sure to choose Import project
from external model and select the Gradle option.
Alternatively, if the Gradle option does not work, I would attempt to use the Eclipse option.
Open .gradle file when you import the project, not the folder of the proyect.

couldn't import BaseGameUtils properly

I a don't use Android Studio and I have followed this post. I have downloaded the Base Game Utils and replaced the file BaseGameUtils\libs\android-support-v4 with android-support-v4. I also replaced GameHelper.
You need to run "make_eclipse_compat" script, located at Scripts/make_eclipse_compat in order to be able to import all of these projects using eclipse (they are created to use by Android-Studio by default).
Once you have run the script, a new folder called "eclipse_compat" will be created. You need to import the projects located at THAT folder. So, import BaseGameUtils, mark it as library and add a google_play_services as a library dependence.
Hope it helps

BaseGameUtils import using Eclipse

Hey :) I am trying to add the BaseGameUtils library to my workspace, I am using this guide: https://developers.google.com/games/services/android/init , I have downloaded from here :https://developers.google.com/games/services/downloads/ The BaseGameUtils sample but when I am trying to import it using Eclipse it gives me so many wrong things like Main,MainActivity and not the real BaseGameUtils, what is wrong here?
You need to run "make_eclipse_compat" script, located at Scripts/make_eclipse_compat in order to be able to import all of these projects using eclipse (they are created to use by Android-Studio by default).
Once you have run the script, a new folder called "eclipse_compat" will be created. You need to import the projects located at THAT folder. So, import BaseGameUtils, mark it as library and add a google_play_services as a library dependence.
Hope it helps

How to get PhoneGap 3.5 Android Hello World to work in Eclipse?

I used PhoneGap 2.* without any problems, but now I cannot, for the life of me, get a basic “hello world” to work. I want to use the “platform-centered workflow” because my 2.* projects have a lot of customization.
Here’s what I’m doing:
I’nm on a Mac and have a folder ~/desktop/android with all my Eclipse projects.
Download https://www.apache.org/dist/cordova/platforms/cordova-android-3.5.0.zip
Unzip it and put it in ~/desktop/android/cordova-android
Run /users/me/desktop/android/cordova-android/bin/create /users/me/desktop/android/hello com.example.hello HelloWorld
The project is successfully created!!!
As per the PhoneGap docs, I go to File > New Project > Android Project from Existing Code and select the “hello” directory.
I also check “copy projects into workspace” because it doesn’t work if unchecked.
There are actually two projects HelloWorld and HelloWorld-CordovaLib. I check them both.
If I try to run HelloWorld as an Android application, I get the following errors:
Config cannot be resolved
CordovaActivity cannot be resolved to a type (x3)
The import org.apache.cordova cannot be resolved
The method on Create(Bundle) of type HelloWorld must override or implement a supertype method
After looking over some previous questions, I decide to import cordova-android using File > Import > Existing Project into Workspace
Right click on the new Cordova folder in Eclipse and under Android make sure is Library is checked.
I clean and build everything.
I now get the error “the project cannot be built until path errors are resolved”
What do I need to do to get a basic hello world PhoneGap 3.5 working???
I figured out that the problem was creating the project in the default Eclipse project directory. I created the project in a new directory:
/users/me/desktop/android/cordova-android/bin/create /users/me/desktop/mynewfolder/hello com.example.hello HelloWorld
Then in Eclipse, I did File > New Project > Android Project from Existing Code, check both projects but did NOT check copy projects into workspace.
Now I see that the HelloWorld-CordovaLib is green checked under libraries. After a few cleans and builds it all works.
As mentat said, I did not need to import the conrova-android project.
You don't have to import cordova-android. Make sure you have a reference to HelloWorld-CordovaLib by right click on HelloWorld project, Properties -> Android - Library list -> Add
It should have a green check for CordovaLib. Also try project -> clean the project, Eclipse needs it often.

how to run the CWAC-Camera demo?

Eclipse will not run the cwac-camera-master demo. The project builds but there is no bin directory and the AndroidManifest.xml has the MainActivity as the category.LAUNCHER.
I have not edited the download per Mark's instructions. If I uncheck "is Library" then the outter project becomes Runnable but that doesn't have a Launcher.
I'm doing something wrong with the inner/outter project config. Can someone please point me in a direction?
Thanks
Jeff
There are three projects: the Android library project, a demo/ sub-project, and a demo-v9/ sub-project.
Download the ZIP archive for the repository and unZIP it somewhere on your development machine. Import the top-level project into Eclipse, then import the demo/ sub-project into Eclipse. Everything should line up for that. If you wish to import the demo-v9/ sub-project, you will need to modify that demo project to reference your own copy of ActionBarSherlock, which that demo uses for its action bar.

Categories

Resources