Affdex SDK Conflict with OpenVokaturi SDK


#1

I have designed an APP using your Affdex sdk and it was working properly. Then I want to add a voice emotion recognition function to this APP by using the OpenVokaturi SDK.

dependencies {
implementation(name: ‘OpenVokaturi-3-0-android’, ext: ‘aar’)
implementation ‘com.affectiva.android:affdexsdk:3.2’
}

allprojects {
repositories {
google()
jcenter()
maven {
url “http://maven.affectiva.com
}
flatDir {
dirs ‘libs’
}
}
}

After writing the gradle like this and sync project without a single change of the java file and the Manifest. I run the app project on the same device. The app crashes every time I opened it. However, if I commented out the code implementing the OpenVokaturi SDK

implementation(name: ‘OpenVokaturi-3-0-android’, ext: ‘aar’)

and clean project and run it again. It goes back to normal. I found the following exception while opening the app.

UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/base.apk”, zip file “/data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_dependencies_apk.apk”, zip file “/data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_resources_apk.apk”, zip file “/data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_0_apk.apk”, zip file “/data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_1_apk.apk”, zip file “/data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_2_apk.apk”, zip file “/data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_3_apk.apk”, zip file “/data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_4_apk.apk”, zip file “/data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_5_apk.apk”, zip file “/data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_6_apk.apk”, zip file “/data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_7_apk.apk”, zip file “/data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_8_apk.apk”, zip file “/data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_9_apk.apk”],nativeLibraryDirectories=[/data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/lib/arm64, /data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/base.apk!/lib/arm64-v8a, /data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_dependencies_apk.apk!/lib/arm64-v8a, /data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_resources_apk.apk!/lib/arm64-v8a, /data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_0_apk.apk!/lib/arm64-v8a, /data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_1_apk.apk!/lib/arm64-v8a, /data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_2_apk.apk!/lib/arm64-v8a, /data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_3_apk.apk!/lib/arm64-v8a, /data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_4_apk.apk!/lib/arm64-v8a, /data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_5_apk.apk!/lib/arm64-v8a, /data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_6_apk.apk!/lib/arm64-v8a, /data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_7_apk.apk!/lib/arm64-v8a, /data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_8_apk.apk!/lib/arm64-v8a, /data/app/com.shiang.depressiondetect-dyv914KSjq4B9GQ27N_cHw==/split_lib_slice_9_apk.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]] couldn’t find “libaffdexface_jni.so”
at java.lang.Runtime.loadLibrary0(Runtime.java:1011)

It seems the AS is not able to find the affective native shared library.
I also posted this question on Stack overflow.

Thank you!


#2

The native library packaged with the Affectiva SDK is armeabi-v7a -based, but from the log output above, it looks like the code is looking for an arm64-v8a lib.


#3

Is there any way to solve this? The weird thing is if I command out the OpenVokaturi SDK. It can work normally. Therefore I through it was an SDK conflict.


#4


I tried the OpenVokaturi SDK on the sample app as well. The app starts to crash and jump to the main menu. I tried the app on both my Huawei P9 and the virtual device. The log error codes are the same.


#5

Solved by configure only using armeabi and armeabi-v7a libraries.
Please refer https://stackoverflow.com/questions/30946365/how-to-import-only-selected-native-library-abis-from-aar


#6

Great, glad you figured it out, and thanks for sharing the solution!