gomobile bind -target android only generates an android/arm library, however many new phones such as the Nexus 5x are android/arm64. The generated libraries are incompatible and return an error when accessed.
11-05 16:37:18.387 2581 2664 E AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
...
11-05 16:37:18.387 2581 2664 E AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
11-05 16:37:18.387 2581 2664 E AndroidRuntime: Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/co.myapp/base.apk"],nativeLibraryDirectories=[/data/app/co.myapp/lib/arm64, /data/app/co.myapp/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]] couldn't find "libgojni.so"
11-05 16:37:18.387 2581 2664 E AndroidRuntime: at java.lang.Runtime.loadLibrary(Runtime.java:367)
11-05 16:37:18.387 2581 2664 E AndroidRuntime: at java.lang.System.loadLibrary(System.java:1076)
11-05 16:37:18.387 2581 2664 E AndroidRuntime: at go.LoadJNI.<clinit>(LoadJNI.java:5)
11-05 16:37:18.387 2581 2664 E AndroidRuntime: at java.lang.Class.classForName(Native Method)
11-05 16:37:18.387 2581 2664 E AndroidRuntime: at java.lang.Class.forName(Class.java:324)
11-05 16:37:18.387 2581 2664 E AndroidRuntime: at java.lang.Class.forName(Class.java:285)
11-05 16:37:18.387 2581 2664 E AndroidRuntime: at go.Seq.<clinit>(Seq.java:23)
11-05 16:37:18.387 2581 2664 E AndroidRuntime: at go.mobilepgp.Mobilepgp.NewKeyPair(Mobilepgp.java:168)
11-05 16:37:18.387 2581 2664 E AndroidRuntime: at co.charge.messenger.util.EncryptionUtil$GenerateKeyTask.doInBackground(EncryptionUtil.java:140)
11-05 16:37:18.387 2581 2664 E AndroidRuntime: at co.charge.messenger.util.EncryptionUtil$GenerateKeyTask.doInBackground(EncryptionUtil.java:117)
11-05 16:37:18.387 2581 2664 E AndroidRuntime: at android.os.AsyncTask$2.call(AsyncTask.java:295)
11-05 16:37:18.387 2581 2664 E AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
11-05 16:37:18.387 2581 2664 E AndroidRuntime: ... 4 more
Gomobile saves libgojni.so under armeabi-v7a but probably should compile android/arm64 and place under arm64-v8a.
gomobile bind -target android
only generates an android/arm library, however many new phones such as the Nexus 5x are android/arm64. The generated libraries are incompatible and return an error when accessed.Gomobile saves libgojni.so under armeabi-v7a but probably should compile android/arm64 and place under arm64-v8a.