Search code examples
javaandroidlibvlc

LibVlc android cant load libs


I tried to run the example of libvlc.I compiled the vlc to android and copy the sdk library to the project as they wrote. https://bitbucket.org/edwardcw/libvlc-android-sample

and I recive this error

 1236-1236/com.compdigitec.libvlcandroidsample E/VLC/LibVLC﹕ Can't load vlcjni library: java.lang.UnsatisfiedLinkError: Couldn't load vlcjni from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.compdigitec.libvlcandroidsample-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.compdigitec.libvlcandroidsample-1, /system/lib]]]: findLibrary returned null

in this lines their is the problem

  try {
           System.loadLibrary("vlcjni");
       } catch (UnsatisfiedLinkError ule) {
           Log.e(TAG, "Can't load vlcjni library: " + ule);
           /// FIXME Alert user
           System.exit(1);
       }

under libs/armeabi-v7a I have those files

gdb.setup
gbdserver
libiomx-hc.so
libiomx-gingerbread.so
libiomx-ics.so
libvlcjni.so

I think that the .so files dont loaded. How can I fix this?

I checked in the apk files and their is no dic libs. or any of libvlc files..

this is my build.gradle file

 apply plugin: 'com.android.application'

  android {
compileSdkVersion 19
buildToolsVersion "20.0.0"

defaultConfig {
    applicationId "com.compdigitec.libvlcandroidsample"
    minSdkVersion 7
    targetSdkVersion 17
}

buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
    debug {
    }
}

 }
dependencies {
  compile 'com.android.support:support-v4:18.0.0'


 }

Thanks


Solution

  • After a long night I found the solution so if someone needs it:

    1. I put the lib directory in zip file.

    2. changed the name to .jar.

    3. go to File ->project structure -> dependencies -> then I add the jar file..

    and then this works.