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

No such static method: 'com.facebook.react.ReactInstanceManagerBuilder com.facebook.react.ReactInstanceManager.builder ()' #22937

Closed
kishangpt opened this issue Jan 10, 2019 · 1 comment
Labels
Bug Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.

Comments

@kishangpt
Copy link

Environment

React Native Environment Info:
System:
OS: Linux 4.4 Ubuntu 16.04.5 LTS (Xenial Xerus)
CPU: (4) x64 Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz
Memory: 149.66 MB / 11.65 GB
Shell: 4.3.48 - /bin/bash
Binaries:
Node: 11.6.0 - /usr/bin/node
Yarn: 1.12.3 - /usr/bin/yarn
npm: 6.5.0-next.0 - /usr/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28
Build Tools: 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.1, 27.0.2, 27.0.3, 28.0.0, 28.0.0, 28.0.0, 28.0.1, 28.0.2, 28.0.3
npmPackages:
react: 16.6.3 => 16.6.3
react-native: ^0.57.8 => 0.57.8
npmGlobalPackages:
react-native-cli: 2.0.1

Description

I have an existing native application and I integrated react-native into it. I have added an activity as mentioned in http://facebook.github.io/react-native/docs/integration-with-existing-apps. But as soon as I launch this activity, I get an exception with stacktrace as below:

PID:19295 java.lang.NoSuchMethodError: No static method builder()Lcom/facebook/react/ReactInstanceManagerBuilder; in class Lcom/facebook/react/ReactInstanceManager; or its super classes (declaration of 'com.facebook.react.ReactInstanceManager' appears in /data/app/com...-rcet5Tnxiu0dRzX1LDQFIQ==/base.apk) //////////////////// Stack Trace //////////////////// at com.....*.presentation.view.activity.MyReactActivity.onCreate(MyReactActivity.java:21) at android.app.Activity.performCreate(Activity.java:7173) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2901) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3023) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1689) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6919) 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:1370)

Reproducible Demo

public class MyReactActivity extends Activity implements DefaultHardwareBackBtnHandler {
private ReactRootView mReactRootView;
private ReactInstanceManager mReactInstanceManager;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mReactRootView = new ReactRootView(this);
    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModulePath("index")
            .addPackage(new MainReactPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();
    // The string here (e.g. "MyReactNativeApp") has to match
    // the string in AppRegistry.registerComponent() in index.js
    mReactRootView.startReactApplication(mReactInstanceManager, "MyReactNativeApp", null);

    setContentView(mReactRootView);
}
.........

}

Its always reproducible as soon as MyReactActivity is launched.

@bartolkaruza
Copy link

bartolkaruza commented Mar 19, 2019

Please provide a repository with a minimal reproduction, so we can quickly see what this issue is. We are happy to reopen once that is there.

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

No branches or pull requests

4 participants