我已将我的反应原生应用程序退出到Expokit。我正在尝试使用react native firebase。按照android installation page上给出的反应原生firebase的设置说明后,当我执行' react-native run-android'我收到一个错误:
MainApplication.java:37: error: cannot find symbol
new MainReactPackage(),
^
symbol: class MainReactPackage
location: class MainApplication
MainApplication.java如下所示:
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()
);
}
}
答案 0 :(得分:2)
尝试将此行添加到MainApplication.java
:
import com.facebook.react.shell.MainReactPackage;