本文主要是介绍flutter ‘Gradle Libs‘ was added by build file ‘app/build.gradle‘,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
相关问题解释文章
How to prefer settings.gradle repositories over build.gradle
repositoriesMode 解释
问题描述
此问题是,直接创建的flutter项目,需要配置其他的maven仓库地址,和第三方module,结果始终都是无法成功
错误异常信息
Build was configured to prefer settings repositories over project repositories but repository'Gradle Libs' was added by build file 'app/build.gradle'
解决方案
找到你的flutter sdk的路径,找到 settings.gradle.kts文件
xxxxxx\flutter\packages\flutter_tools\gradle\settings.gradle.kts
修改为如下配置
dependencyResolutionManagement {repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)repositories {google()mavenCentral()}
}
主要原因是配置这个选择项目,FAIL_ON_PROJECT_REPOS,任何直接在项目中声明的第三方仓库,都是无法使用的
我的博客
简书
csdn
这篇关于flutter ‘Gradle Libs‘ was added by build file ‘app/build.gradle‘的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!