我在Windows 10(64位)上使用Android Studio版本3.3。以下是发生错误的虚拟设备的特征:
Movesense移动库版本:1.28.1。
我从Movesense网站(https://bitbucket.org/suunto/movesense-mobile-lib/downloads/)下载了文件夹suunto-movesense-mobile-lib-e78baa174a4a,并尝试运行适用于Android的各种示例。我要显示的问题已记录在ECGSample中,但其他三个问题也已出现。 该应用程序正确构建,但是当我在虚拟设备上运行该应用程序时,出现以下错误:
安装失败,并显示消息无法完成会话:
INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.
(更改Android设备和API版本,发生相同的错误)。我解决了此问题,并将其添加到模块的build.gradle脚本中Android {}块内:
splits {
abi {
enable true
reset()
include 'x86', 'armeabi-v7a'
universalApk true
}
}
执行此操作后,该应用程序已在虚拟设备上启动,但不幸的是立即崩溃。该应用程序可以正常启动,但是会立即关闭,并显示以下消息:
" Movesense ECG sample keeps stopping".
通过检查Logcat,我遇到以下错误:
2019-02-08 12:03:28.641 4770-4770/com.movesense.samples.ecgsampleE/AndroidRuntime: FATAL EXCEPTION: main
Process: com.movesense.samples.ecgsample,PID: 4770
java.lang.UnsatisfiedLinkError:No implementation found for void com.movesense.mds.SDSInternalWrapper.sdsSetDelegate(java.lang.Object)(tried Java_com_movesense_mds_SDSInternalWrapper_sdsSetDelegate and Java_com_movesense_mds_SDSInternalWrapper_sdsSetDelegate__Ljava_lang_Object_2)
at com.movesense.mds.SDSInternalWrapper.sdsSetDelegate(NativeMethod)
at com.movesense.mds.SDSInternalWrapper.setDelegate(SDSInternalWrapper.java:167)
at com.movesense.mds.internal.operation.MdsOperationHandler.<init>(MdsOperationHandler.java:87)
at com.movesense.mds.Mds$Builder.build(Mds.java:357)
at com.movesense.samples.ecgsample.MainActivity.initMds(MainActivity.java:85)
at com.movesense.samples.ecgsample.MainActivity.onCreate(MainActivity.java:70)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(NativeMethod)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
要捕获真正的问题,我们调试程序,它得到一个错误,错误是“找不到“ libmds.so”。 详细信息:
System.loadLibrary(mds) FAILED! Error: sds: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/base.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_dependencies_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_resources_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_0_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_1_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_2_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_3_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_4_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_5_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_6_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_7_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_8_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/lib/x86, /system/lib]]] couldn't find "libmds.so"
发生错误的代码。
private native void sdsSetDelegate(Object var1);
static {
try {
Log.d("SDSInternalWrapper", "Start load library call [mds]");
System.loadLibrary("mds"); (Error occurred)
Log.d("SDSInternalWrapper", "Finished load library call [mds]");
} catch (UnsatisfiedLinkError var2) {
String error = String.format("System.loadLibrary(mds) FAILED! Error: sds: %s", var2);
Log.e("SDSInternalWrapper", error);
}
}
答案 0 :(得分:0)
在展示应用程序中的build.gradle中,mdslib-.aar库应位于相对于项目位于“ ../Movesense/”的Movesense文件夹中,或者如果您尝试其他示例,则应位于在“ ../../../Movesense/”上放置了它吗?
如果不尝试保持此处的文件夹结构https://bitbucket.org/suunto/movesense-mobile-lib/src/master/android/
|_Movesense/
| |_libmds-<version>.aar
|
|_Showcasapp/
| |_gradle/
| |_src/
| |
|
|_Samples/
答案 1 :(得分:0)
当前的MDS不支持x86或x64,这就是为什么收到UnsatisfiedLinkError的原因。因此,它暂时不能与Android模拟器一起使用,只能在设备上调试。
完全免责声明:我为Movesense团队工作