1

I have tried to implement Android-FFmpeg-Images-Video android studio project example from reference link.

When I try to run the android application then here it will give error

java.lang.UnsatisfiedLinkError: com.android.tools.fd.runtime. IncrementalClassLoader$DelegateClassLoader nativeLibraryDirectories=[/data/data/com.catcry.ffmpeg/lib, /vendor/lib,/system/lib]]] couldn't find "libffmpeg-jni.so"

static {
    System.loadLibrary("ffmpeg");
    System.loadLibrary("ffmpeg-jni");
}

This is my build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.0"

defaultConfig {
    applicationId "com.example.ffmpeg"
    minSdkVersion 14
    targetSdkVersion 23
    multiDexEnabled true
}

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

dependencies {
compile 'com.android.support:support-v4:23.0.0'
compile project(':ffmpeg4android_os')
compile 'com.android.support:multidex:1.0.1'
}

This is My Directory Structure

Dir

seenukarthi
  • 8,241
  • 10
  • 47
  • 68

4 Answers4

9

Just turn off instant-run from Setting/Preferences -> Build,Execution,Deployment -> Instant Run and uncheck the first two check-boxes. This error is because of instant-run feature.

poortechworker
  • 627
  • 1
  • 6
  • 21
Zain Ul Abideen
  • 151
  • 1
  • 3
1

I had the same issue. I solved it by creating a folder structure as image below showing.

Copy your .so files to armeabi-v7a.

this is project view

This is android view>

enter image description here

Amir
  • 8,821
  • 7
  • 44
  • 48
akhil tccsa
  • 69
  • 1
  • 5
0

UnsatisfiedLinkError is due to the libffmpeg-jni.so file missing on your android project. Please try for correct library.

Sreejin
  • 151
  • 7
0

Your code

sourceSets {
    main {
        res.srcDirs = ['src/main/res']

        jni.srcDirs = [] // This prevents the auto generation of Android.mk
    }
}

does not corresponds to your folder structure. Put 'jniLibs' under 'src/main' folder.

You can check this SO post for folder structure. jniLibs are not extended in gradle

Community
  • 1
  • 1
yeh
  • 1,496
  • 14
  • 35