react-native-navigation,“方法不会覆盖”Android版

时间:2018-01-25 07:42:14

标签: react-native react-native-android react-native-navigation

嗨我在运行react-native run-android

时使用RNN获得以下内容

MainApplication.java:22: error: MainApplication is not abstract and does not override abstract method createAdditionalReactPackages() in NavigationApplication public class MainApplication extends NavigationApplication{ ^ MainApplication.java:31: error: method does not override or implement a method from a supertype @Override ^

我的MainApplication.java(代码段):https://pastebin.com/8eFNguPn

我正在使用 react-native-cli:2.0.1 反应原生:0.51.0

2 个答案:

答案 0 :(得分:2)

如错误消息所示:您没有覆盖NavigationApplication的抽象方法的方法。你必须添加:

@Override
public List<ReactPackage> createAdditionalReactPackages() {
    return getPackages();
}

答案 1 :(得分:0)

缺少

@Override
public boolean isDebug() {
   return BuildConfig.DEBUG;
}