Unsatisfied communication error while initializing Myo hub on Android

I am developing an Android application that will use Myo armband. I want to implement it as an accessibility service, so that a gesture detected by a bandage can, for example, move around the house, etc.

I am trying to initialize a hub, but the application 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 that I use to initialize the hub, according to the Myo documentation. I tried to put it in the onCreate and onServiceConnected methods of the accessibility service, in any case, an error occurs.

  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 am using the latest Myo Android SDK. Testing on Nexus 5 with the latest firmware.

For me, this seems like an error inside the SDK, but maybe this has something to do with my configuration? Any help would be appreciated.

The samples specified in the SDK do not seem to suffer from the same problem.

In theory, the libgesture-classifier.so file is added as follows:

  • I include the Myo SDK in the project via 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 ') } 
  • Myorepository contains myosdk-0.10.0.aar.

  • What when I treat it as zip contains libs / native-libs.jar

  • Which, in turn, when checking as a zip, contains a list of architecture folders each of which contains a single libgesture-classifier.so file

+6
source share
1 answer

I could solve the problem by reverting to an earlier version of the gradle plugin for Android. There seems to be a problem with the native libraries in myosdk, they are not being copied correctly.

Just edit the build.gradle file from the project. Version 1.3.0 worked for me.

 // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { mavenCentral() } dependencies { **classpath 'com.android.tools.build:gradle:1.3.0'** } } 
+1
source

All Articles