-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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: ReactInstanceManagerBuilder.build fails unless SoLoader.init has been called #26342
Labels
Bug
p: Microsoft
Partner: Microsoft
Partner
Platform: Android
Android applications.
Resolution: Locked
This issue was locked by the bot.
Comments
facebook-github-bot
pushed a commit
that referenced
this issue
Sep 6, 2019
#26343) Summary: This change fixes the issue "[ReactInstanceManagerBuilder.build fails unless SoLoader.init has been called](#26342)" on Android. The `ReactInstanceManager` constructor calls `initializeSoLoaderIfNecessary`, so the intent is clearly that things should work without an explicit call to `SoLoader.init` on the part of the application. However, with the introduction of Hermes, we have `ReactInstanceManagerBuilder.getDefaultJSExecutorFactory`, which gets called before the `ReactInstanceManager` constructor. It attempts this: SoLoader.loadLibrary("jscexecutor"); This fails with the following stack trace: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.facebook.react.uiapp/com.facebook.react.uiapp.RNTesterActivity}: java.lang.RuntimeException: SoLoader.init() not yet called at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2957) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) Caused by: java.lang.RuntimeException: SoLoader.init() not yet called at com.facebook.soloader.SoLoader.assertInitialized(SoLoader.java:781) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:505) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484) at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:291) at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:266) at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:86) at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:38) at com.facebook.react.ReactDelegate.loadApp(ReactDelegate.java:103) at com.facebook.react.ReactActivityDelegate.loadApp(ReactActivityDelegate.java:83) at com.facebook.react.ReactActivityDelegate.onCreate(ReactActivityDelegate.java:78) at com.facebook.react.uiapp.RNTesterActivity$RNTesterActivityDelegate.onCreate(RNTesterActivity.java:40) at com.facebook.react.ReactActivity.onCreate(ReactActivity.java:44) at android.app.Activity.performCreate(Activity.java:7183) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) ## Changelog [Android] [Fixed] - Don't crash ReactInstanceManagerBuilder.build even if SoLoader has not been explicitly initialized Pull Request resolved: #26343 Test Plan: To demonstrate the defect, remove the call to `SoLoader.init` from `RNTester.onCreate` and run the app. To demonstrate the fix, apply this PR, which does in fact also remove the call to `SoLoader.init` Differential Revision: D17223701 Pulled By: mdvacca fbshipit-source-id: c508ab52bd3fefe8a946ebab7b2906a5d8c21e0f
Hello there 👋 this issue seems to have been inactive for the past few years. Because of this, it's likely that the issue is not a high priority anymore or it has been solved by OP; for these reasons, we'll close it. But please, if it's actually still an issue with latest (RN64 at the time of writing) please comment below and we can reopen it or please send a Pull Request with a fix 😊 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Bug
p: Microsoft
Partner: Microsoft
Partner
Platform: Android
Android applications.
Resolution: Locked
This issue was locked by the bot.
Android:
ReactInstanceManagerBuilder.build
fails unlessSoLoader.init
has been explicitly called.The
ReactInstanceManager
constructor callsinitializeSoLoaderIfNecessary
, so the intent is clearly that things should work without an explicit call toSoLoader.init
on the part of the application. However, with the introduction of Hermes, we haveReactInstanceManagerBuilder.getDefaultJSExecutorFactory
, which gets called before theReactInstanceManager
constructor. It attempts this:This fails. A simple fix is to ensure that the
SoLoader
is initialized first. I have a PR that fixes the issue.React Native version:
Steps To Reproduce
RNTester.onCreate
, remove the call toSoLoader.init
The app crashes with the following stack trace:
Related issues
These touch upon the issue, but have been closed after workarounds were found:
The text was updated successfully, but these errors were encountered: