SimpleNativeCars Android Studio Couldn't load c++_shared

Community support forum for the ARToolKit v5.x for Android SDK.
User avatar
Wizao
Posts: 3
Joined: Mon Feb 08, 2016 8:44 am

SimpleNativeCars Android Studio Couldn't load c++_shared

Postby Wizao » Sun Jun 26, 2016 3:35 pm

Hi, i was working with SimpleNativeCars with Eclipse and all work fine, but now i tried to move out to Android Studio with the news versions, but i cant make it run, becouse when the app, run in the movile phone it crashes with this error.

Image

i work with jdk 1.8, and I Tried with NDK 10,11 and 12. If Someone can help me i will be so glad. :cry:

Code: Select all

FATAL EXCEPTION: main
                                                                                           Process: org.artoolkit.ar.samples.ARSimpleNativeCars, PID: 9175
                                                                                           java.lang.UnsatisfiedLinkError: Couldn't load c++_shared from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.artoolkit.ar.samples.ARSimpleNativeCars-8.apk"],nativeLibraryDirectories=[/data/app-lib/org.artoolkit.ar.samples.ARSimpleNativeCars-8, /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.artoolkit.ar.samples.ARSimpleNativeCars.SimpleNativeRenderer.<clinit>(SimpleNativeRenderer.java:64)
                                                                                               at org.artoolkit.ar.samples.ARSimpleNativeCars.ARSimpleNativeCarsActivity.<init>(ARSimpleNativeCarsActivity.java:60)
                                                                                               at java.lang.Class.newInstanceImpl(Native Method)
                                                                                               at java.lang.Class.newInstance(Class.java:1208)
                                                                                               at android.app.Instrumentation.newActivity(Instrumentation.java:1068)
                                                                                               at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
                                                                                               at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2370)
                                                                                               at android.app.ActivityThread.access$800(ActivityThread.java:155)
                                                                                               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1243)
                                                                                               at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                               at android.os.Looper.loop(Looper.java:136)
                                                                                               at android.app.ActivityThread.main(ActivityThread.java:5426)
                                                                                               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:1268)
                                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
                                                                                               at dalvik.system.NativeStart.main(Native Method)

gizmo
Posts: 363
Joined: Sun Mar 13, 2016 2:06 pm

Re: SimpleNativeCars Android Studio Couldn't load c++_shared

Postby gizmo » Thu Jul 07, 2016 8:31 pm

Hi,

I'm sad to say that the OpenSceneGraph support is currently not working any more due to C++ runtime issues and different C++ versions used by OSG and ARToolKit. You could try one of the older SDKs but I don't know if they will work. Otherwise try one of the examples without OSG usage.

Cheers
If I responded on a post and miss keeping up please ping the post again. Sometimes they just slip through :-) .

ndgAlainB
Posts: 6
Joined: Tue Feb 21, 2017 11:45 pm

Re: SimpleNativeCars Android Studio Couldn't load c++_shared

Postby ndgAlainB » Thu Feb 23, 2017 4:00 am

Same problem for me but in fact, I had to manually copy the libs directory.
After that, I got a new error:

Code: Select all

E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: org.artoolkit.ar.samples.ARSimpleNativeCars, PID: 13450
                  java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.artoolkit.ar.samples.ARSimpleNativeCars-2/base.apk"],nativeLibraryDirectories=[/data/app/org.artoolkit.ar.samples.ARSimpleNativeCars-2/lib/arm, /data/app/org.artoolkit.ar.samples.ARSimpleNativeCars-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find "libARWrapperNativeCarsExample.so"
                      at java.lang.Runtime.loadLibrary(Runtime.java:367)
                      at java.lang.System.loadLibrary(System.java:1076)
                      at org.artoolkit.ar.samples.ARSimpleNativeCars.SimpleNativeRenderer.<clinit>(SimpleNativeRenderer.java:66)
                      at org.artoolkit.ar.samples.ARSimpleNativeCars.ARSimpleNativeCarsActivity.<init>(ARSimpleNativeCarsActivity.java:60)
                      at java.lang.Class.newInstance(Native Method)
                      at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                      at android.app.ActivityThread.-wrap11(ActivityThread.java)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:148)
                      at android.app.ActivityThread.main(ActivityThread.java:5417)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)


Where is libARWrapperNativeCarsExample.so supposed to be?

gizmo
Posts: 363
Joined: Sun Mar 13, 2016 2:06 pm

Re: SimpleNativeCars Android Studio Couldn't load c++_shared

Postby gizmo » Thu Feb 23, 2017 10:12 am

Did you run:
https://github.com/artoolkit/artoolkit5 ... er/android

build_native_examples.sh ?
If I responded on a post and miss keeping up please ping the post again. Sometimes they just slip through :-) .

ndgAlainB
Posts: 6
Joined: Tue Feb 21, 2017 11:45 pm

Re: SimpleNativeCars Android Studio Couldn't load c++_shared

Postby ndgAlainB » Mon Feb 27, 2017 8:42 am

Ohh, I didn't see that , sorry.
Thanks


Return to “ARToolKit for Android”

Who is online

Users browsing this forum: No registered users and 2 guests