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

wtf java.lang.RuntimeException:SoLoader.init() not yet called #10379

Closed
sopaco opened this issue Oct 14, 2016 · 10 comments
Closed

wtf java.lang.RuntimeException:SoLoader.init() not yet called #10379

sopaco opened this issue Oct 14, 2016 · 10 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@sopaco
Copy link

sopaco commented Oct 14, 2016

What's wrong?

java.lang.ExceptionInInitializerError:
2 com.facebook.react.bridge.NativeMap.<clinit>(NativeMap.java:22)
3 ......
4 Caused by:
5 java.lang.RuntimeException:SoLoader.init() not yet called
6 com.facebook.soloader.SoLoader.assertInitialized(SoLoader.java:335)
7 com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:238)
8 com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:24)
9 com.facebook.react.bridge.ReactBridge.<clinit>(ReactBridge.java:20)
10 com.facebook.react.bridge.NativeMap.<clinit>(NativeMap.java:22)
11 com.facebook.react.bridge.Arguments.createMap(Arguments.java:29)
@tnortman
Copy link

tnortman commented Oct 14, 2016

This also happened to me. My specific case:
I am trying out the HeadlessJsTaskService. If I attempt to spin up the task (service) while the react native app is not running, it will attempt to load two libraries but the SoLoader is not yet initialized.

From ReactBridge.java:

public static void staticInit() {
    SoLoader.loadLibrary(REACT_NATIVE_LIB);
    SoLoader.loadLibrary(XREACT_NATIVE_LIB);
  }

Not sure if this is the same problem you are having, but it seems to be that the React Native Bridge is not making sure the SoLoader is initialized before initializing itself. Again this is only happening for me when the React Native App is not running, however my understanding of the HeadlessJsTaskService is that it is allowed to run when your app is not.

I think this is the same problem they are having in issue #10352

@hramos
Copy link
Contributor

hramos commented Oct 18, 2016

Hey, thanks for reporting this issue.

Can you please add all the info specified in the template? This is necessary for people to be able to understand and reproduce the issue being reported.

@KenChoi1992
Copy link

This problem showed up when calling :

WritableMap map = Arguments.fromBundle(bundle);

The Arguments is from com.facebook.react.bridge.
The app was killed before calling this method, and awakened by click a notification.

@pampang
Copy link

pampang commented Dec 30, 2016

So is there any solution here to avoid this error while React-Native is not ready yet? Should we hold up ongoing process until RN did initialized? But how can we do that?

@ewindso
Copy link
Contributor

ewindso commented Jan 10, 2017

One thing that fixes this for me on 0.38.1 is after initializing ReactNativeHost, immediately calling getReactInstanceManager().

@messense
Copy link

messense commented Feb 16, 2017

@ewindso Could you give us more detail please?

@jsdario
Copy link
Contributor

jsdario commented Jun 30, 2017

@ewindso, any updates? it will be highly appreciated :)

@hramos
Copy link
Contributor

hramos commented Aug 24, 2017

Closing due to lack of follow up from the original author.

@hramos hramos closed this as completed Aug 24, 2017
@sachinwak
Copy link

sachinwak commented Sep 23, 2017

I was getting same issue (checked in logcat). I found there was no function in MainApplication.java as SoLoader.init(this, /* native exopackage */ false); . At the time of adding facebook sdk , I had removed this. Added it back and working fine in my case.

  public void onCreate() {
    super.onCreate();
    FacebookSdk.sdkInitialize(getApplicationContext());
    // If you want to use AppEventsLogger to log events.
    AppEventsLogger.activateApp(this);

    SoLoader.init(this, /* native exopackage */ false);
  }```

@geekyprateek
Copy link

@sachinwak have you found the solution of your problem?

@facebook facebook locked as resolved and limited conversation to collaborators Aug 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests