我的应用app / build gradle:
android:compileSdkVersion 23, buildToolsVersion '26'
android / build gradle:
subprojects { subproject ->
afterEvaluate{
if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
}
}
}
}
包json依赖项:
“react-native-fast-image”:“^ 1.0.0”, “反应”:“16.0.0-alpha.12”, “react-native”:“0.45.1”,
我已安装react-native-fast-image,并与react-native链接。 然后在android上运行时,我收到此错误:
:react-native-fast-image:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
D:\React Practice\MyProject\MyProject\node_modules\react-native-fast-image\android\src\main\java\com\dylanvann\fastimage\FastImageViewPackage.java:14: error: FastImageViewPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class FastImageViewPackage implements ReactPackage {
^
Note: D:\React Practice\MyProject\MyProject\node_modules\react-native-fast-image\android\src\main\java\com\dylanvann\fastimage\FastImageViewManager.java uses unchecked or un
safe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:react-native-fast-image:compileReleaseJavaWithJavac FAILED
答案 0 :(得分:1)
此错误已在最新版本的react-native-fast-image修复。
或者您可以手动修复我的编辑node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageViewPackage.java
并添加:
@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
此外,如果您已将react-native
升级到大于0.47.0的版本(在您的示例中使用的是0.45.1),则需要删除@Override
注释。