[英]How do i make all build scripts to appear before plugins
That is my code, and when那是我的代码,什么时候
try to sync, I get this error:
尝试同步,我收到此错误:
Gradle sync failed: Cause: startup failed:
build file 'C:\Users\user\AndroidStudioProjects\Chiro\build.gradle': 12: all buildscript {} blocks must appear before any plugins {} blocks in the script
See https://docs.gradle.org/7.2/userguide/plugins.html#sec:plugins_block for information on the plugins {} block
@ line 12, column 1.
buildscript{
^
Instead of putting the builscript at line 12而不是将 builscript 放在第 12 行
put it at line 1放在第 1 行
Refer this official docs External dependencies for the build script参考这个官方文档External dependencies for the build script
If you are getting google repo error, try to remove google() under repositories and use mavenCentral()如果您收到 google repo 错误,请尝试删除存储库下的 google() 并使用 mavenCentral()
In addition with Dickens AS Answer, you need to change this configuration in settings.gradle(Project Settings)除了使用 Dickens AS Answer 之外,您还需要在 settings.gradle(Project Settings) 中更改此配置
Instead of this: repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)而不是这个:repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
you can use this: repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)你可以使用这个:repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.