今天您好,我在项目中安装了react-native-maps,并对其进行了配置,但是当我运行react-native run-android
时,它向我显示错误:
> Task :app:compileDebugJavaWithJavac FAILED
/home/valentino/Scrivania/test/android/app/src/main/java/com/test/MainApplication.java:38: error: method does not override or implement a method from a supertype
@Override
^
1 error
this is the link of the guide I followed on github to configure react-native-maps.
在MainApplication.java中,我添加了import com.airbnb.android.react.maps.MapsPackage
和
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new MapsPackage()
);
}
在public class MainApplication extends Application implements ReactApplication {
中。
你知道我能克服这个问题吗?
更新
TheWanderer解决了先前的问题后,终端向我显示以下错误:
> Task :app:compileDebugJavaWithJavac FAILED
/home/valentino/Scrivania/test/android/app/src/main/java/com/test/MainApplication.java:38: error: method getPackages() is already defined in class <anonymous com.test.MainApplication$1>
protected List<ReactPackage> getPackages() {
^
1 error
谢谢