我的AndroidStudio项目构建良好,但是当我调用 Activity 并通过SDK创建MediaManager对象时,遇到了以下错误:
07-06 20:35:18.520 6521-6521/de.sanbot.sanbotapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: de.sanbot.sanbotapp, PID: 6521
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/de.sanbot.sanbotapp-1/base.apk"],nativeLibraryDirectories=[/data/app/de.sanbot.sanbotapp-1/lib/arm, /data/app/de.sanbot.sanbotapp-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find "libuvcNative.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.qihancloud.opensdk.function.unit.MediaManager.<clinit>(MediaManager.java:77)
at com.qihancloud.opensdk.base.BindBaseActivity.getUnitManager(BindBaseActivity.java:674)
这是我的build.gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "de.sanbot.sanbotapp"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation(name: 'QihanOpenSDK_1.1.8.0', ext: 'aar')
implementation 'com.skype.android.skype-android-sdk:MobileSdk:1.0.0.0'
implementation 'org.tensorflow:tensorflow-android:1.6.0'
implementation 'com.jakewharton:butterknife:8.5.1'
implementation files('libs/gson-2.2.4.jar')
}
repositories {
jcenter()
flatDir {
dirs 'libs'
}
}
我发现了this问题,但我不想添加其他库。这个人有一个不同的错误。如果我添加abiFilter(如建议)
android {
...
defaultConfig {
...
ndk {
abiFilters 'armeabi'
}
}
}
我收到另一个错误:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: de.sanbot.sanbotapp, PID: 12237
java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/de.sanbot.sanbotapp-1/lib/arm/libuvcNative.so: has text relocations
at java.lang.Runtime.loadLibrary(Runtime.java:372)
at java.lang.System.loadLibrary(System.java:1076)
at com.qihancloud.opensdk.function.unit.MediaManager.<clinit>(MediaManager.java:77)
at com.qihancloud.opensdk.base.BindBaseActivity.getUnitManager(BindBaseActivity.java:674)
任何提示都会对我有很大帮助!
更新:
that是我必须走的方向吗?
最佳答案
通过将targetSdkVersion从26
更改为22
来解决此问题。不知道这是否是正确的方法,但确实成功了。
新的build.gradle
文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "de.sanbot.sanbotapp"
minSdkVersion 23
targetSdkVersion 22
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
}
}
}
...
关于android - Android Studio:UnsatisfiedLinkError:dlopen失败:/lib/arm/libuvcNative.so:具有文本重定位,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51212233/