This question is a subsequent thread following this other question of mine.
After finally managing to successfully building the apk file using gradle and cmake to integrate FFMPEG into an Android project I am facing a new exception which is thrown when calling System.loadLibrary
.
java.lang.UnsatisfiedLinkError: dlopen failed: library "libavutil.so.56" not found
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1657)
at com.hmomeni.canto.activities.EditActivity.<init>(EditActivity.kt:26)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1174)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
This is the part of code which is causing the error:
class EditActivity : AppCompatActivity(), View.OnClickListener {
init {
System.loadLibrary("Canto")
}
...
}
I tried moving the .so
files inside the PROJECT/app/jniLibs
and then adding the following line to build.gradle
file to no avail.
sourceSets.main.jniLibs.srcDirs = ['./jniLibs/']