razorRun/react-native-vlc-media-player

App crashes at launch (mismatching libc++_shared.so)

Yooooomi opened this issue · 6 comments

Hello!
First, thanks a lot for the project.

I'm using react-native-tvos (react-native 0.71) and I don't know if that's making any difference.
After installing react-native-vlc-media-player, I can't start the application (it compiles well).

These are the logs:

09-02 16:12:47.703 32444 32444 E AndroidRuntime: FATAL EXCEPTION: main
09-02 16:12:47.703 32444 32444 E AndroidRuntime: Process: com.app, PID: 32444
09-02 16:12:47.703 32444 32444 E AndroidRuntime: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so caused by: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/~~Bl9uPaLXnGY6D4CkvW_VFA==/com.app-Tj61xGfnRjCr6hhdy_c9tA==/lib/arm64/libfolly_runtime.so"... result: 0
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:24)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:369)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:316)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:94)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.app.MainApplication.onCreate(MainApplication.java:60)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1266)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6785)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2134)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:201)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7898)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/~~Bl9uPaLXnGY6D4CkvW_VFA==/com.app-Tj61xGfnRjCr6hhdy_c9tA==/lib/arm64/libfolly_runtime.so"...
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at java.lang.Runtime.load0(Runtime.java:929)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at java.lang.System.load(System.java:1625)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.soloader.SoLoader$1.load(SoLoader.java:558)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:110)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:63)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.soloader.ApplicationSoSource.loadLibrary(ApplicationSoSource.java:91)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
09-02 16:12:47.703 32444 32444 E AndroidRuntime: 	... 23 more

It feels like the older version of libc++_shared.so does not implement some required symbols. Any idea how I could fix that? Maybe libvlc works well with the react-native required libc++_shared.so?

Thanks for any help

EDIT: similar issue on vlc-android

AnZuev commented

Same issue after react-native upgrade from 0.71 to 0.73.
Any workaround?

Following. Also blocked by this issue.

I made a fork and the fix, it works ok using eas on ios and android

package.json

"dependencies": { 
  "expo": "~49.0.15", 
  "react-native": "0.72.6", 
  "react-native-vlc-media-player": "git+https://github.com/aguileraps/react-native-vlc-media-player.git"
}

ignore android configuration so it does not run withAppBuildGradle

app.json

"plugins": [
  [
    "react-native-vlc-media-player",
    {
      "ios": {
        "includeVLCKit": false
      }
    }
  ]
]

It is not tested with react-native-vlc-media-player-test
If someone can do the test and confirm that it works, I'll send the PR

I am having the same issue. Everything was working fine and then out of nowhere Android would no longer build (getting the same error as you). So I tried creating a new blank repo and only adding this package and getting the same error. No clue on how it worked initially if even a new repo is broken on start...

Is there any update to this issue?

I am using Expo and this is the packages for my fresh repo

{
  "name": "my-app",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "expo": "~50.0.8",
    "expo-status-bar": "~1.11.1",
    "react": "18.2.0",
    "react-native": "0.73.4",
    "react-native-vlc-media-player": "^1.0.67"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0"
  },
  "private": true
}

I believe the issue started when I moved my "plugins" key in the app.json inside of the expo: (after looking at the expo documentation to realize that I had it wrong ). Before it looked this

{
  "expo": {
    "name": "my-app",
    "slug": "my-app",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "android": {
      "package": "com.anonymous.myapp"
    }
  },
  "plugins": [
      [
          "react-native-vlc-media-player",
          {
              "ios": {
                  "includeVLCKit": false
              },
              "android": {
                  "legacyJetifier": false
              }
          }
      ]
  ]
}

then moved it to the inside

{
  "expo": {
    "name": "my-app",
    "slug": "my-app",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "android": {
      "package": "com.anonymous.myapp"
    },
    "plugins": [
        [
            "react-native-vlc-media-player",
            {
                "ios": {
                    "includeVLCKit": false
                },
                "android": {
                    "legacyJetifier": false
                }
            }
        ]
    ]
  }
}