Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Error when loading lib: dlopen failed: library "libjsc.so" #4

Closed
andresesfm opened this issue Jul 9, 2019 · 7 comments
Closed

Comments

@andresesfm
Copy link

After following implementation steps in README.md. The app compiles and attempts to launch but crashes with the following exception:

SoLoader: couldn't find DSO to load: libreactnativejni.so caused by: dlopen failed: library "libjsc.so" not found
2019-07-08 17:06:20.412 17787-17879/com.nfl.videoreference.debug E/AndroidRuntime: FATAL EXCEPTION: create_react_context
    Process: com.app.debug, PID: 17787
    java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so caused by: dlopen failed: library "libjsc.so" not found
        at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738)
        at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484)
        at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:31)
        at com.facebook.react.bridge.NativeMap.<clinit>(NativeMap.java:19)
        at com.facebook.react.jscexecutor.JSCExecutorFactory.create(JSCExecutorFactory.java:25)
        at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:944)
        at java.lang.Thread.run(Thread.java:761)

According to https://stackoverflow.com/questions/43368926/android-reactnative-java-lang-unsatisfiedlinkerrorcould-find-dso-to-load-libre This could be related to a missing 64bit library.

Note that we cannot revert to 32bit since Google will soon enforce 64bit support

Any pointers would be appreciated.

@Kudo
Copy link
Owner

Kudo commented Jul 9, 2019

What is your RN version?
Could you please also check your build.gradle if there are any url("$rootDir/../node_modules/react-native/android")?
Please make sure to exclude official RN maven repo and use the react-native-v8 repo instead.
Thanks.

@andresesfm
Copy link
Author

Hello, we are using RN 0.59.9
Yes, there is a reference to that path:

maven {
            // Replace AAR from original RN with AAR from react-native-v8
            url("$rootDir/$NODE_MODULES_DIR/react-native-v8/dist")
        }
        maven {
            // prebuilt libv8.so
            url("$rootDir/$NODE_MODULES_DIR/v8-android/dist")
         }
         maven {
             // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
             url "$rootDir/$NODE_MODULES_DIR/react-native/android"
         }

Removing it causes the following compilation error:

Execution failed for task ':react-native-community_async-storage:compileDebugRenderscript'.
> Could not resolve all files for configuration ':react-native-community_async-storage:debugCompileClasspath'.
   > Could not find com.facebook.react:react-native:0.59.9.
     Required by:
         project :react-native-community_async-storage

At first, I thought it would be something related to that particular project but if I remove that reference then another module fails with a similar error.

By your question about the version, I assume you are thinking that the library was compiled with a lower version of RN. Correct?

@andresesfm
Copy link
Author

Or actually, quite the opposite, I just looked at the package.json file and it provides "RN_VERSION": "v0.60.0"

@bhaskarGyan
Copy link

@andresesfm react-native version and react-native-v8 version should be same.

image

@Kudo
Copy link
Owner

Kudo commented Jul 10, 2019

Yes as @bhaskarGyan said, the version should be matched.
Currently, 0.59.x is not supported yet. are there any reasons not to try RN 0.60?

@andresesfm
Copy link
Author

Yup, it makes sense. We have a task to update to .60 but since it requires a big overhaul due to the androidx change

@Kudo
Copy link
Owner

Kudo commented Aug 6, 2019

@andresesfm FYI. As there are many people getting frustration to upgrade 0.60 for AndroidX, I did backport RN V8 support to 0.59.10.
yarn add 'react-native-v8@>=0.59.10-patch.0 <0.59.11'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants