I just upgraded to React Native 0.63.3
.....I also upgraded Android studio to 4.1.1
and gradle plugin to 4.1.0
.
Im getting the error cannot find symbol class ReactInstanceManager
when I try to build.
The error is in file MainApplication.java
.....see code below.
Appears the error is with the line initializeFlipper(this,getReactNativeHost().getReactInstanceManager());
.
It seems to be saying that Im providing com.facebook.react.ReactInstanceManager
....but what the program wants is ReactInstanceManager
.
It says Get the current ReactInstanceManager instance, or create one.
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
* We use reflection here to pick up the class that initializes Flipper, since
* Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.xs.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
I missed a single line of code during my upgrgade of RN from 0.61.5 to 0.63.3. import com.facebook.react.ReactInstanceManager;
was missing from MainApplication.java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With