mrmaffen / vlc-android-sdk

VLC Android SDK pushed to Maven Central. Primarily used in project tomahawk-android.
792 stars 244 forks source link

No implementation found for void org.videolan.libvlc.LibVLC.nativeNew #61

Closed Allier closed 7 years ago

Allier commented 7 years ago

When I try to use libVLC from your dependency my app crashes with: Caused by: java.lang.UnsatisfiedLinkError: No implementation found for void org.videolan.libvlc.LibVLC.nativeNew(java.lang.String[], java.lang.String) (tried Java_org_videolan_libvlc_LibVLC_nativeNew and Java_org_videolan_libvlc_LibVLC_nativeNew___3Ljava_lang_String_2Ljava_lang_String_2) at org.videolan.libvlc.LibVLC.nativeNew(Native Method) at org.videolan.libvlc.LibVLC.<init>(LibVLC.java:82) Maybe I miss something? I just use compile 'de.mrmaffen:vlc-android-sdk:2.0.6' in my Gradle dependency

mrmaffen commented 7 years ago

Make sure your output apk does in fact contain the necessary library files (*.so) in /jni/$ARCH/

Allier commented 7 years ago

Yes, it does contain liblvc.so and libvlcjni.so among others

eseffair commented 7 years ago

@Allier, you solved?

Allier commented 7 years ago

@eseffair Yes, my fault, there were another .so build in a project, thanks for responce

matthiasdittmer commented 7 years ago

Could someone please post his build.gradle and folder structure? My *.so are in the folder /lib/ in the apk

My build.gradle

....
    sourceSets { main {
        assets.srcDirs = ['src/main/assets', 'src/main/assets/']
        jni {
            srcDirs = []
        }
        jniLibs {
            srcDir 'src/main/jniLibs'
        }
    } }
}

repositories {
    mavenCentral()
}

allprojects {
    repositories {
        jcenter()
        flatDir {
            dirs 'lib'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.anjlab.android.iab.v3:library:1.0.+@aar'
    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.android.support:design:25.0.0'
    compile 'com.github.hotchemi:permissionsdispatcher:2.3.2'
    annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:2.3.2'
    compile 'com.squareup.okhttp3:okhttp:3.6.0'
    //compile(name:'libvlc_3.0.0', ext:'jar')
   // androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    compile "de.mrmaffen:vlc-android-sdk:2.0.6"
}
matthiasdittmer commented 7 years ago

Solved. Added missing: static { System.loadLibrary("vlc"); System.loadLibrary("vlcjni"); }

kpurushottam commented 7 years ago

When I try to use libVLC from your dependency my app crashes with: Caused by: java.lang.UnsatisfiedLinkError: No implementation found for void org.videolan.libvlc.LibVLC.nativeNew(java.lang.String[], java.lang.String) (tried Java_org_videolan_libvlc_LibVLC_nativeNew and Java_org_videolan_libvlc_LibVLC_nativeNew___3Ljava_lang_String_2Ljava_lang_String_2) at org.videolan.libvlc.LibVLC.nativeNew(Native Method) at org.videolan.libvlc.LibVLC.(LibVLC.java:82) Maybe I miss something? I just use compile 'de.mrmaffen:vlc-android-sdk:2.0.6' in my Gradle dependency

Mazabbas commented 6 years ago

what's the solution ?? had anyone solved the problem? @kpurushottam @mrmaffen @mrmaffen where do i put that code of you?