How to use v3.7 pro.android-studio?

What version of Cocos2d-x was used to create your project?

is it working?

Yes, thanks. Got it working. The problem was that I blindly copied the paths from my android folders Android.mk, so it wasnā€™t finding paths because I used ā€¦/ā€¦/ instead of ā€¦/ā€¦/ā€¦/ (the android studio path is different). The first time it takes a really long time to open in Android studio.

1 Like

Thanks for your reply,

I resolved my issue by downloading latest source and compiling & installing by commandline.

Good to hear :smiley:

#SonarSystems. I tired to compile my proj.android-studio via terminal with command ā€œcocos compile -p android --android-studioā€ but its fails with the following error. Same error I am facing when I run the command cocos compile -p android.

WeRplays-MacBook-Pro-3:AndroidFinal werplay$ cocos compile -p android --android-studio
Running command: compile
Building mode: debug
Android platform not specified, searching a default oneā€¦
running: ā€˜/Applications/Development/adt-bundle-mac-x86_64-20140321/sdk/tools/android update project -t android-19 -p /Users/werplay/Documents/Cocos2d Projects/AndroidFinal/proj.androidā€™

Error: Argument ā€˜Projects/AndroidFinal/proj.androidā€™ is not recognized.

   Usage:
   android [global options] update project [action options]
   Global options:

-h --help : Help on a specific command.
-v --verbose : Verbose mode, shows errors, warnings and all messages.
ā€“clear-cache: Clear the SDK Manager repository manifest cache.
-s --silent : Silent mode, shows errors only.

                     Action "update project":

Updates an Android project (must already have an AndroidManifest.xml).
Options:
-l --library : Directory of an Android library to add, relative to this
projectā€™s directory.
-p --path : The projectā€™s directory. [required]
-n --name : Project name.
-t --target : Target ID to set for the project.
-s --subprojects: Also updates any projects in sub-folders, such as test
projects.
Error running command, return code: 1

I followed every step of your video. Help me out. :ā€™)

@SonarSystems Iā€™m facing the same problem as above. Could you guys help us please?

Thank you very much!

Edit: I finally managed to compile it for Android Studio. The problem is that there are spaces between foldersā€™ names. So, @shahidammer try to move your AndroidFinal folder to Desktop and compile it again. If you find another way to solve this problem please post it here. Thanks!

1 Like

Spaces are very much an issue

Anyway, thank you very much for what you are doing!

1 Like

Your welcome :smiley:

Hello Everybody, I have downloaded the latest version cocos2d-x v 3.11 and run it on eclipse, I got followingerror,

06-18 19:08:29.752: E/AndroidRuntime(27570): FATAL EXCEPTION: main
06-18 19:08:29.752: E/AndroidRuntime(27570): Process: com.test.testGame1, PID: 27570
06-18 19:08:29.752: E/AndroidRuntime(27570): java.lang.UnsatisfiedLinkError: Couldnā€™t load MyGame from loader dalvik.system.PathClassLoader[DexPathList[[zip file ā€œ/data/app/com.test.testGame1-1.apkā€],nativeLibraryDirectories=[/data/app-lib/com.test.testGame1-1, /vendor/lib, /system/lib]]]: findLibrary returned null
06-18 19:08:29.752: E/AndroidRuntime(27570): at java.lang.Runtime.loadLibrary(Runtime.java:358)
06-18 19:08:29.752: E/AndroidRuntime(27570): at java.lang.System.loadLibrary(System.java:526)
06-18 19:08:29.752: E/AndroidRuntime(27570): at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:246)
06-18 19:08:29.752: E/AndroidRuntime(27570): at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:260)
06-18 19:08:29.752: E/AndroidRuntime(27570): at android.app.Activity.performCreate(Activity.java:5249)
06-18 19:08:29.752: E/AndroidRuntime(27570): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
06-18 19:08:29.752: E/AndroidRuntime(27570): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2165)
06-18 19:08:29.752: E/AndroidRuntime(27570): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250)
06-18 19:08:29.752: E/AndroidRuntime(27570): at android.app.ActivityThread.access$900(ActivityThread.java:141)
06-18 19:08:29.752: E/AndroidRuntime(27570): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1213)
06-18 19:08:29.752: E/AndroidRuntime(27570): at android.os.Handler.dispatchMessage(Handler.java:102)
06-18 19:08:29.752: E/AndroidRuntime(27570): at android.os.Looper.loop(Looper.java:136)
06-18 19:08:29.752: E/AndroidRuntime(27570): at android.app.ActivityThread.main(ActivityThread.java:5072)
06-18 19:08:29.752: E/AndroidRuntime(27570): at java.lang.reflect.Method.invokeNative(Native Method)
06-18 19:08:29.752: E/AndroidRuntime(27570): at java.lang.reflect.Method.invoke(Method.java:515)
06-18 19:08:29.752: E/AndroidRuntime(27570): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-18 19:08:29.752: E/AndroidRuntime(27570): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
06-18 19:08:29.752: E/AndroidRuntime(27570): at dalvik.system.NativeStart.main(Native Method)
ā€¦
I am getting this error while running test program.
Kindly help please.

@bpdubey87

With cocos2d-x v3.11.1,
I am using NDK10c (also have tried with NDK9d) and both works fine for me.

I think your error is related to NDK versions.