I'm developing an Android application which will use Myo armband. I want to implement it as an accessibility service, so that gestured detected by the armband could, e.g. navigate home etc.
I'm trying to initialize the hub, but the app stops with the following error stack:
01-06 23:42:41.222 11979-11979/eu.miko.myoid E/AndroidRuntime: FATAL EXCEPTION: main
Process: eu.miko.myoid, PID: 11979
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/eu.miko.myoid-1/base.apk"],nativeLibraryDirectories=[/data/app/eu.miko.myoid-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libgesture-classifier.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.thalmic.myo.scanner.Scanner.<clinit>(Scanner.java:31)
at com.thalmic.myo.Hub.init(Hub.java:201)
at eu.miko.myoid.MyoidAccessibilityService.onCreate(MyoidAccessibilityService.java:21)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2877)
at android.app.ActivityThread.-wrap4(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1427)
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)
This is the code I use for hub initialization, as per Myo documentation. I've tried putting it in both the onCreate and onServiceConnected methods of the accessibility service, the error comes up anyhow.
Hub hub = Hub.getInstance();
if (hub.init(this, getPackageName())) {
Intent intent = new Intent(this, ScanActivity.class);
startActivity(intent);
hub.setLockingPolicy(Hub.LockingPolicy.NONE);
hub.addListener(mListener);
}
else {
Log.e(TAG, "Could not initialize the Hub.");
}
I'm using the most recent Myo Android SDK. Testing on Nexus 5 with most recent firmware.
To me it seems like an error inside of the SDK, but perhaps it's something to do with my configuration? Any help would be appreciated.
The samples given in the SDK don't seem to suffer from the same issue though.
In theory, the libgesture-classifier.so file is added, through the following:
I'm including the Myo SDK in the project through the build.gradle file:
dependencies { ... repositories { maven { // this must point to the myorepository distributed with the Myo SDK url '../myorepository' } } compile('com.thalmic:myosdk:0.10.+@aar') }
The myorepository contains myosdk-0.10.0.aar.
Which, when I examine it as a zip, contains libs/native-libs.jar
Which, in turn when examined as a zip, contains , each of which contains the single file libgesture-classifier.so
libgesture-classifier.so
files to your app? – Unwittingsrc/main/jniLibs
folder as a workaround. – Ferdie