Cannot run basic Android Studio project

Trying the latest v3.14.1 and testing on various platforms. Cannot make it work with Android Studio using instructions provided.

In the instructions (http://cocos2d-x.org/docs/installation/Android-Studio/ ) it simply states to import the cpp-tests project into AndroidStudio and it should work.

Here is what happens…

02/20 18:11:12: Launching CppTests
$ adb push /Users/djogon/Projects/Cocos2D/cocos3/cocos2d-x-3/tests/cpp-tests/proj.android-studio/app/build/outputs/apk/CppTests-debug.apk /data/local/tmp/org.cocos2dx.cpp_tests
$ adb shell pm install -r "/data/local/tmp/org.cocos2dx.cpp_tests"
Success


$ adb shell am start -n "org.cocos2dx.cpp_tests/org.cocos2dx.cpp_tests.AppActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Connected to process 2444 on device Nexus_5X_API_25_x86 [emulator-5554]
I/art: Not late-enabling -Xcheck:jni (already on)
W/art: Unexpected CPU variant for X86 using defaults: x86
E/art: Failed sending reply to debugger: Broken pipe
I/art: Debugger is no longer active
I/art: Starting a blocking GC Instrumentation
W/System: ClassLoader referenced unknown path: /data/app/org.cocos2dx.cpp_tests-1/lib/x86
I/InstantRun: Instant Run Runtime started. Android package is org.cocos2dx.cpp_tests, real application class is null.
W/System: ClassLoader referenced unknown path: /data/app/org.cocos2dx.cpp_tests-1/lib/x86
D/AndroidRuntime: Shutting down VM


                  --------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: org.cocos2dx.cpp_tests, PID: 2444
                  java.lang.UnsatisfiedLinkError: com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader[DexPathList[[dex file "/data/data/org.cocos2dx.cpp_tests/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/org.cocos2dx.cpp_tests/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/org.cocos2dx.cpp_tests/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/org.cocos2dx.cpp_tests/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/org.cocos2dx.cpp_tests/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/org.cocos2dx.cpp_tests/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/org.cocos2dx.cpp_tests/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/org.cocos2dx.cpp_tests/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/org.cocos2dx.cpp_tests/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/org.cocos2dx.cpp_tests/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/org.cocos2dx.cpp_tests/files/instant-run/dex/slice-httpclient-4.4.1.1_103db9099acb485a9b58672ea8ef5e7bfa50ccf1-classes.dex", dex file "/data/data/org.cocos2dx.cpp_tests/files/instant-run/dex/slice-com.android.vending.expansion.zipfile_95689658e2c159ff1188b26c526e3f93072bf553-classes.dex", dex file "/data/data/org.cocos2dx.cpp_tests/files/instant-run/dex/slice-android-async-http-1.4.9_ddc857f5c3bf947e5867d2252a8e0daa14105bba-classes.dex"],nativeLibraryDirectories=[/data/app/org.cocos2dx.cpp_tests-1/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libcpp_tests.so"
                      at java.lang.Runtime.loadLibrary0(Runtime.java:984)
                      at java.lang.System.loadLibrary(System.java:1530)
                      at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:248)
                      at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:264)
                      at android.app.Activity.performCreate(Activity.java:6679)
                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
                      at android.app.ActivityThread.-wrap12(ActivityThread.java)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:154)
                      at android.app.ActivityThread.main(ActivityThread.java:6119)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Application terminated.

Seems to be that cocos2d-x library was not even built. It couldn’t have built it this fast.
After some digging - I found out that if I compile from the command line (which properly builds the library) I can actually run it, but only on a real device. I cannot run it on the emulator as the library was not build for the emulator from the command line.

The question really is - am I missing something or Is the documentation wrong?
If I’m not missing anything from the documentation - could someone post a complete noob’s guide to AndroidStudio? :slight_smile: How do we create a project, build it and run it on the emulator and on a real device.

Thanks!