我已经使用您的Affdex sdk设计了一个APP,并且运行正常。然后,我想使用OpenVokaturi SDK向此APP添加语音情感识别功能。 通过添加声明并设置依赖项,gradle编写如下:
allprojects {
repositories {
google()
jcenter()
maven {
url "http://maven.affectiva.com"
}
flatDir {
dirs 'libs'
}
}
}
dependencies {
implementation(name: 'OpenVokaturi-3-0-android', ext: 'aar')
implementation 'com.affectiva.android:affdexsdk:3.2'
像这样编写gradle并同步项目后,无需更改Java文件和清单。我在同一设备上运行该应用程序项目。每次我打开应用程序时,该应用程序就会崩溃。但是,如果我注释掉实施OpenVokaturi SDK的代码
implementation(name: ‘OpenVokaturi-3-0-android’, ext: ‘aar’)
清理项目并再次运行。它恢复正常。打开应用程序时,我发现以下异常。
2018-10-16 12:48:24.207 5091-5091/com.shiang.depressiondetect E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.shiang.depressiondetect, PID: 5091
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.shiang.depressiondetect-1/base.apk", zip file "/data/app/com.shiang.depressiondetect-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.shiang.depressiondetect-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.shiang.depressiondetect-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.shiang.depressiondetect-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.shiang.depressiondetect-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.shiang.depressiondetect-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.shiang.depressiondetect-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.shiang.depressiondetect-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.shiang.depressiondetect-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.shiang.depressiondetect-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.shiang.depressiondetect-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.shiang.depressiondetect-1/lib/x86, /data/app/com.shiang.depressiondetect-1/base.apk!/lib/x86, /data/app/com.shiang.depressiondetect-1/split_lib_dependencies_apk.apk!/lib/x86, /data/app/com.shiang.depressiondetect-1/split_lib_slice_0_apk.apk!/lib/x86, /data/app/com.shiang.depressiondetect-1/split_lib_slice_1_apk.apk!/lib/x86, /data/app/com.shiang.depressiondetect-1/split_lib_slice_2_apk.apk!/lib/x86, /data/app/com.shiang.depressiondetect-1/split_lib_slice_3_apk.apk!/lib/x86, /data/app/com.shiang.depressiondetect-1/split_lib_slice_4_apk.apk!/lib/x86, /data/app/com.shiang.depressiondetect-1/split_lib_slice_5_apk.apk!/lib/x86, /data/app/com.shiang.depressiondetect-1/split_lib_slice_6_apk.apk!/lib/x86, /data/app/com.shiang.depressiondetect-1/split_lib_slice_7_apk.apk!/lib/x86, /data/app/com.shiang.depressiondetect-1/split_lib_slice_8_apk.apk!/lib/x86, /data/app/com.shiang.depressiondetect-1/split_lib_slice_9_apk.apk!/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libaffdexface_jni.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:972)
at java.lang.System.loadLibrary(System.java:1530)
at com.affectiva.android.affdex.sdk.detector.AffdexFaceJNI.<clinit>(SourceFile:20)
at com.affectiva.android.affdex.sdk.detector.AffdexFaceJNI$$InjectAdapter.get(SourceFile:27)
at com.affectiva.android.affdex.sdk.detector.AffdexFaceJNI$$InjectAdapter.get(SourceFile:14)
at com.affectiva.android.affdex.sdk.detector.AffdexFaceJNIWrapper$$InjectAdapter.get(SourceFile:52)
at com.affectiva.android.affdex.sdk.detector.AffdexFaceJNIWrapper$$InjectAdapter.get(SourceFile:19)
at com.affectiva.android.affdex.sdk.detector.FrameProcessor$$InjectAdapter.get(SourceFile:62)
at com.affectiva.android.affdex.sdk.detector.FrameProcessor$$InjectAdapter.get(SourceFile:23)
at com.affectiva.android.affdex.sdk.detector.CameraDetector$$InjectAdapter.injectMembers(SourceFile:71)
at com.affectiva.android.affdex.sdk.detector.CameraDetector$$InjectAdapter.injectMembers(SourceFile:22)
at dagger.ObjectGraph$DaggerObjectGraph.inject(ObjectGraph.java:281)
at com.affectiva.android.affdex.sdk.detector.Detector.<init>(SourceFile:69)
at com.affectiva.android.affdex.sdk.detector.CameraDetector.<init>(SourceFile:72)
at com.affectiva.android.affdex.sdk.detector.CameraDetector.<init>(SourceFile:111)
at com.shiang.depressiondetect.MainActivity.onCreate(MainActivity.java:154)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
2018-10-16 12:48:24.208 5091-5091/com.shiang.depressiondetect E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
2018-10-16 12:48:24.351 1620-4726/system_process E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
2018-10-16 12:48:24.351 1620-4726/system_process E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
我的设备是华为P9(HiSilicon Kirin 955,八核(4x2.5 GHz Cortex-A72和4x1.8 GHz Cortex-A53)。