Android crash on MuseManager.refreshPairedMuses(); [libmuse 1.2.0]


#1

I’ve had a user report a crash via Google Play and I can’t re-create it.

java.lang.UnsatisfiedLinkError: Couldn't load muse from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.sonicPenguins.museMonitor-3.apk"],nativeLibraryDirectories=[/data/app-lib/com.sonicPenguins.museMonitor-3, /vendor/lib, /system/lib, /system/lib/arm]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.interaxon.libmuse.MuseManager.<clinit>(MuseManager.java:35)
at com.sonicPenguins.museMonitor.MainActivity.connectDefaultDevice(MainActivity.java:857)
at com.sonicPenguins.museMonitor.MainActivity.onCreate(MainActivity.java:474)
at android.app.Activity.performCreate(Activity.java:5541)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2368)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2464)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
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:5653)
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:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)

Line 857 is:

MuseManager.refreshPairedMuses();

Prior to that in onCreate, I’ve checked that bluetooth both exists and is enabled, so I’m not sure how refreshPairedMuses could possibly fail at this point. Any ideas?


#2

Thanks for the report.
The problem is not in refreshPairedMuses() method. This is just happens to be the first method in MuseManager, which is called and MuseManager loads the native library:
static {
System.loadLibrary(“muse”);
}

For some reason, java cannot find that native library: [SIZE=12px]findLibrary returned null, [/SIZE]which is really weird.
We will investigate that.


#3

Now working in libmuse 1.2.1 as per https://sites.google.com/a/interaxon.ca/muse-developer-site/release-notes
Thank you :slight_smile: