gpt4 book ai didi

android - react native Android : Method does not override or implement a method from a supertype

转载 作者:可可西里 更新时间:2023-11-01 18:46:44 28 4
gpt4 key购买 nike

我已将 react-native-fbsdk 添加到我的 React Native 项目中,并让它在 iOS 上正常构建。但是在android端,我无法通过gradle来构建项目。尝试编译 react-native-fbsdk 时,我遇到了:“方法不会覆盖或实现父类(super class)型的方法”

21:41:11.863 [INFO] [org.gradle.api.internal.tasks.compile.JdkJavaCompiler] Compiling with JDK Java compiler API.
21:41:12.100 [ERROR] [system.err] /Users/joncursi/Sites/joncursi/redbirdNative/node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/FBSDKPackage.java:61: error: method does not override or implement a method from a supertype

它指向 react-native-fbsdk 中的以下代码 fragment :

@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}

当我删除 @Override 时,这个特定的错误实例消失了,但我在另一个模块中遇到了同样的错误,例如 react-native-image-picker :

:react-native-image-picker:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/Users/joncursi/Sites/joncursi/redbirdNative/node_modules/react-native-image-picker/android/src/main/java/com/imagepicker/ImagePickerPackage.java:34: error: method does not override or implement a method from a supertype
@Override
^
1 error

我怀疑这是我本地设置的问题。关于这里可能出什么问题的任何想法?

最佳答案

错误非常模糊(我觉得 React Native 发布流程有点困惑)。

React-native 0.47.0 有一个重大变化,这意味着库必须修补他们的代码。

Remove unused createJSModules calls (ce6fb33, 53d5504) - source

我的猜测是您只需更新出现此错误的库,否则提交 PR。

这是修复它的库示例:https://github.com/rebeccahughes/react-native-device-info/pull/191/files

更新:

你等的PR在这里:https://github.com/facebook/react-native-fbsdk/pull/354

关于android - react native Android : Method does not override or implement a method from a supertype,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45580452/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com