Cocos2d-x version is 3.9 , 3.8.1 or git current
System
Mac OS X 10.11.2 El Capitan
with Android SDK installed with Android Studio (December 2015)
NDK_ROOT=/Volumes/Home/Library/Android/android-ndk-r10e
ANDROID_SDK_ROOT=/Volumes/Home/Library/Android/sdk
ANT_ROOT=/usr/local/Cellar/ant/1.9.6/bin
device is Samsumg Galaxy Tab4
Did a standard installation
cocos new mygame -p com.your_company.mygame -l cpp
cd mygame
running from the command line with ant
cocos run -p android --ap android-21
app builds, installs on device, when run a message dialog shows
“Unfortunatley, mygame has stopped”
when building with gradle from within Android Studio
the logcat shows
FATAL EXCEPTION: main
Process: com.your_company.mygame, PID: 26880
java.lang.UnsatisfiedLinkError: Couldn’t load cocos2dcpp from loader dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/com.your_company.mygame-1.apk”],nativeLibraryDirectories=[/data/app-lib/com.your_company.mygame-1, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:248)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:263)
at android.app.Activity.performCreate(Activity.java:5451)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2377)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
at android.app.ActivityThread.access$900(ActivityThread.java:175)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5602)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
@PedroVicente Thanks a lot for that information! Do you know if this is also needed when using the latest cocos2d-x 3.10?
And, don’t you run into any issues with not supported items in your AndroidManifest when using SDK android-19? For example often some values of android:configChanges are not supported in that SDK yet. What do you do in that case?
@jarsj Unfortunately I’m having trouble finding back that info in GooglePlay’s crashes dashboard. It was a while back and it doesn’t have any search option there.