I need to get a Cocos2D-X project running in Android Studio.
Before, I was using this tutorial with cocos2d-x version 3.4 to get the project up and running. But since then I tried to upgrade to version 3.7 to get the integrated Android Studio project but the cocos compile command threw up errors (Error 2) which I couldn’t figure out.
Using the compile command specifically for Android Studio cocos compile -p android --android-studio also fails with:
What went wrong:
Execution failed for task ‘:findingGameX:processDebugResources’.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/Users/ConorM/Library/Android/sdk/build-tools/22.0.1/aapt’’ finished with non-zero exit value 1
I switched back to version 3.4 and now that will build with the cocos compile but won’t build in Android Studio. Throwing Error (12, 0) about how the NDK is deprecated and to either use the experimental Gradle or allow deprecated NDK in the gradle.settings file.
Some more comprehensive tutorials on this topic would be really appreciated by the community, I think. Using Eclipse+ADT for Android debugging and emulation is as it is quite hard and bug-filled, but as I write this comment it becomes more and more impossible because it is basically not maintained anymore. Android Studio is the legitimate replacement for it with VS2015 as an additional hopeful. Even if SonarSystems’ efforts is being appreciated, a 7min video can’t really cover but the bare essentials.
Im using Android Studio now and Im getting this error using the Cocos Helper classes. Ive been at this for hours
FATAL EXCEPTION: main
Process: ie.blogspot.damorton, PID: 5909
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/ie.blogspot.damorton-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libcocos2dcpp.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:989)
at sonar.systems.framework.SonarFrameworkActivity.<clinit>(SonarFrameworkActivity.java:92)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1650)
at android.app.Instrumentation.newActivity(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2545)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2767)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5951)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
And this error when I try to set the api level to 21
Yes I ran cocos compile -p android --android-studio and then opened it in AS. I have since got it working in Eclipse but its still buggy. Im attempting to use sdkbox now to see if its any better.