简体   繁体   English

React Native - 错误:方法不会覆盖或实现超类型的方法

[英]React Native - error: method does not override or implement a method from a supertype

React Native throws these errors when compiling... React Native在编译时会抛出这些错误......

MainActivity.java:26: MainActivity.java:26:

MainActivity.java:35: MainActivity.java:35:

error: method does not override or implement a method from a supertype error:方法不会覆盖或实现超类型的方法

How should these two functions be changed? 这两个功能应该如何改变?

public class MainActivity extends ReactActivity {


@Override
protected boolean getUseDeveloperSupport() {
    return BuildConfig.DEBUG;
}


@Override
protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        new BeaconsAndroidPackage()
    );
  }
}

Thanks! 谢谢!

Normally you just need to comment out the @Override decorator in MainActivity.java and it should work fine. 通常你只需要在MainActivity.java中注释掉@Override装饰器,它应该可以正常工作。 Try it. 试试吧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React-Native方法不会覆盖或实现超类型的方法 - React-Native method does not override or implement a method from a supertype 方法不会从父类型@override覆盖或实现方法编译错误 - method does not override or implement a method from a supertype @override compile error 错误:(124,9)错误:方法未覆盖或从超类型实现方法 - Error:(124, 9) error: method does not override or implement a method from a supertype 方法不会覆盖或实现超类型的方法 - method does not override or implement a method from a supertype 方法不会覆盖或实现超类型的方法 - method does not override or implement a method from a supertype Java错误:方法未从超类型重写或实现方法 - java error: method does not override or implement a method from a supertype 错误:方法onEnable不会覆盖或实现超类型的方法 - Error: method onEnable does not override or implement a method from a supertype Java“方法没有覆盖或实现来自超类型的方法”错误 - Java "method does not override or implement a method from a supertype" error 错误:方法未覆盖或从超类型实现方法 - error: method does not override or implement a method from a supertype 错误:方法未覆盖或从超类型OnCreateOptionsMenu实现方法 - error: method does not override or implement a method from a supertype OnCreateOptionsMenu
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM