Java Question SLC .aar lib and .so file

warwound

Expert
Licensed User
Longtime User
I'm wrapping part of the GoogleVR SDK and have a problem with the VrVideoView class:
https://developers.google.com/vr/android/reference/com/google/vr/sdk/widgets/video/VrVideoView

I started with the working demo project and created a wrapper.
The demo depends on 3 .aar libs from the GoogleVR SDK: common.aar, commonwidget.aar and videowidget.aar.
videowidget.aar contains a native .so library file and i'm unable to get this library to compile into my .apk (i'm using SLC to compile my library), as soon as i start my app i get an exception such as:

java.lang.UnsatisfiedLinkError: Couldn't load pano_video_renderer from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/mycompany.com.googlevrtest-2.apk"],nativeLibraryDirectories=[/data/app-lib/mycompany.com.googlevrtest-2, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.google.vr.sdk.widgets.video.VrVideoRenderer.<init>(VrVideoRenderer.java:36)
at com.google.vr.sdk.widgets.video.VrVideoView.createRenderer(VrVideoView.java:126)
at com.google.vr.sdk.widgets.video.VrVideoView.createRenderer(VrVideoView.java:14)
at com.google.vr.sdk.widgets.common.VrWidgetView.initializeRenderingView(VrWidgetView.java:318)
at com.google.vr.sdk.widgets.common.VrWidgetView.init(VrWidgetView.java:227)
at com.google.vr.sdk.widgets.common.VrWidgetView.<init>(VrWidgetView.java:186)
at com.google.vr.sdk.widgets.video.VrVideoView.<init>(VrVideoView.java:117)
at mycompany.api.googlevr.widgets.VrVideoView.Initialize(VrVideoView.java:71)
at mycompany.com.googlevrtest.main._activity_create(main.java:338)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at mycompany.com.googlevrtest.main.afterFirstLayout(main.java:102)
at mycompany.com.googlevrtest.main.access$000(main.java:17)
at mycompany.com.googlevrtest.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
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:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)

The .so file is located at:

videowidget.aar\jni\armeabi-v7a\libpano_video_renderer.so

My additional libraries folder contains the 3 required .aar files, and my Main activity contains:
Code: Copy
	#AdditionalJar: common.aar
	#AdditionalJar: commonwidget.aar
	#AdditionalJar: videowidget.aar

Also, my wrapper class contains:
Code: Copy
@BA.DependsOn(values={
        "common.aar",
        "commonwidget.aar",
        "videowidget.aar"
})

Looking at my .apk file using 7Zip i see various resources which belong to the varous .aar file but no .so file.

Any idea what the problem is?

Thanks.
 
Thinking about this...

Shall i create a feature request asking that the IDE fully supports .aar files - including compiling JNI files into the .apk?
 
The IDE doesn't do anything with the jni folder from the aar file.

You can create another jar with no code and only a folder named lib that holds the other three folders (from the aar).

Could this procedure be explained?
How do I create a jar with no code?
 
zip the lib folder
rename the some.zip to some.jar

That´s how i would try it
 
Back
Top