Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot find symbol MainReactPackage

I have ejected my react native app to Expokit. I am trying to use react native firebase. After following the setup instructions for react native firebase as given on android installation page, when I execute 'react-native run-android' I get an error:

MainApplication.java:37: error: cannot find symbol
new MainReactPackage(),
    ^
symbol: class MainReactPackage
location: class MainApplication

The MainApplication.java looks like this:

package com.abc.xyz;

import android.support.multidex.MultiDexApplication;

import com.facebook.react.ReactPackage;

import java.util.Arrays;
import java.util.List;

import io.invertase.firebase.RNFirebasePackage; 
import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage; // Firebase Analytics
import com.facebook.react.ReactApplication;

public class MainApplication extends MultiDexApplication {

  public List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new RNFirebasePackage(),  
          new RNFirebaseAnalyticsPackage()
    );
  }
}
like image 514
Akshey Avatar asked Dec 11 '22 10:12

Akshey


1 Answers

Try adding this line to your MainApplication.java:

import com.facebook.react.shell.MainReactPackage;

like image 61
YaSh Chaudhary Avatar answered Feb 08 '23 03:02

YaSh Chaudhary