0

I am trying to use libmp3lame in application developed in Android Studio.

Even though my gradle build is successful with the experimental gradle, I get an error when trying to open the activity as follows:

E/AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xxx.xxxxx-1/base.apk"],nativeLibraryDirectories=[/system/lib, /vendor/lib, system/vendor/lib, system/vendor/lib/egl, system/lib/hw]]] couldn't find "libmp3lame.so"

Here is my source block from build.grade:

android.sources {
                main {
                    jni {
                        dependencies {
                            library file("libmp3lame.so") abi "x86"
                        }
                    }
                }
    }

Any ideas why Android cannot find the library?

Damian Kozlak
  • 7,065
  • 10
  • 45
  • 51
dancag
  • 11
  • 2
  • I found the answer! I just needed to change the ndk-generate libs directory name to jniLibs. Also, after doing a static call to load the library and even though the native methods from the library are available, they still show red in your java class. But it works – dancag Nov 28 '15 at 14:54
  • In the end, I ended up importing two modules into my android studio project. I used from liblame https://github.com/intervigilium/liblame for encoding and jLayer http://www.javazoom.net/javalayer/javalayer.html for decoding – dancag Nov 28 '15 at 14:59

0 Answers0