react-native-vlc-media-player icon indicating copy to clipboard operation
react-native-vlc-media-player copied to clipboard

can't start streaming

Open kozhinas opened this issue 2 years ago • 2 comments

I can't start watching the broadcast, I get an error:

E/VLC/LibVLC: Can't load vlcjni library: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__sfp_handle_exceptions" referenced by "/data/app/~~0iD7HmnfGFQUdQJ3xy15BQ==/com.appname-oo202GHf6hsrXlxBu6GMFQ==/lib/arm64/libvlc.so"...

kozhinas avatar Apr 20 '23 09:04 kozhinas

Android 8.0 all work, android 12 not work

kozhinas avatar Apr 20 '23 13:04 kozhinas

You need to add this to your android/app/build.gradle

tasks.whenTaskAdded((tas -> {
    // when task is 'mergeLocalDebugNativeLibs' or 'mergeLocalReleaseNativeLibs'
    if (tas.name.contains("merge") && tas.name.contains("NativeLibs")) {
        tasks.named(tas.name) {it
            doFirst {
                java.nio.file.Path notNeededDirectory = it.externalLibNativeLibs
                        .getFiles()
                        .stream()
                        // for React Native 0.71, the file value now contains "jetified-react-android" instead of "jetified-react-native"
                        .filter(file -> file.toString().contains("jetified-react-native"))
                        .findAny()
                        .orElse(null)
                        .toPath();
                Files.walk(notNeededDirectory).forEach(file -> {
                    if (file.toString().contains("libc++_shared.so")) {
                        Files.delete(file);
                    }
                });
            }
        }
    }
}))

All the details are explained in the readme https://github.com/razorRun/react-native-vlc-media-player#android

gandous avatar Apr 26 '23 19:04 gandous