java.lang.UnsatisfiedLinkError after switching from Android Sudio 3.2.1 to 4.1.2

429 views Asked by At

I've an android app using IJKPlayer with ffmpeg*.so libraries. In a small test app, IJKPlayer libraries are references like this:

apply plugin: 'com.android.library'

android {
    // http://tools.android.com/tech-docs/new-build-system/tips
    //noinspection GroovyAssignabilityCheck
    compileSdkVersion rootProject.ext.compileSdkVersion
    //noinspection GroovyAssignabilityCheck
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        minSdkVersion 25
        targetSdkVersion rootProject.ext.targetSdkVersion
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets.main {
        jniLibs.srcDirs 'src/main/libs'
        jni.srcDirs = [] // This prevents the auto generation of Android.mk
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

apply from: new File(rootProject.projectDir, "tools/gradle-on-demand.gradle");

This works fine with Android Studio 3.2.1. After doing nothing else then opening the project with Android Studio 4.1.2 and building/running it, the app fails with error:

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.nvp.test.nvptest-N7MgBlkuRYXx_vQKF6j4jw==/base.apk"],nativeLibraryDirectories=[/data/app/com.nvp.test.nvptest-N7MgBlkuRYXx_vQKF6j4jw==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "libijkffmpeg.so"

Any idea why? Looking at the error message, are these the directories, where android searches the libraries: /lib/arm64, /system/lib64, /system/vendor/lib64 ?

In this case it must fail, because the libraries are stored under /lib/armeabi-v7a. What must be done to make android searching this path? Why doest it work with 3.2.1, then?

Any hints are welcome.

1

There are 1 answers

0
Harry Developer On

I've created a new project from scratch and moved it from android studio 3.2.1 to 4.1.2. Now it works. Hence, the problem must be hidden somewhere in the android version chaos.