gpt4 book ai didi

android - react-native, "abortOnError false",但由于 lint 错误,android 构建失败

转载 作者:行者123 更新时间:2023-12-02 02:34:04 25 4
gpt4 key购买 nike

在我的 react-native 应用程序中,为 android 构建时出现 lint 错误失败。我想忽略它,但添加推荐的脚本并不能解决问题,而且构建仍然失败

./gradlew build

* What went wrong:
Execution failed for task ':react-native-maps:lint'.
> Lint found errors in the project; aborting build.

Fix the issues identified by lint, or add the following to your build script to proceed with errors:
...
android {
lintOptions {
abortOnError false
}
}
...

并已将推荐添加到app/build.gradle

android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {...}
defaultConfig {...}
splits {...}
signingConfigs {...}
buildTypes {...}
packagingOptions {...}

lintOptions {
abortOnError false
}
}

最佳答案

你应该修改 android/build.gradle 而不是 android/app/build.gradle 因为 react-native-maps 是第三个-派对项目。

allprojects {
// append here
afterEvaluate {
if (getPlugins().hasPlugin('android') ||
getPlugins().hasPlugin('android-library')) {
configure(android.lintOptions) {
abortOnError false
checkReleaseBuilds false
}
}
}
}

然后运行 ​​./gradlew clean 在另一个构建之前配置每个项目。

关于android - react-native, "abortOnError false",但由于 lint 错误,android 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64593433/

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