AS报错:The pluginManagement {} block must appear before any other statements in the script.

本人的Android studio版本基础信息

Android Studio Bumblebee | 2021.1.1 Patch 3
Build #AI-211.7628.21.2111.8309675, built on March 17, 2022
Runtime version: 11.0.11+9-b60-7590822 amd64
VM: OpenJDK 64-Bit Server VM by Oracle Corporation
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 12
Registry: external.system.auto.import.disabled=true, ide.windowSystem.autoShowProcessPopup=true, ide.tooltip.initialDelay=695
Non-Bundled Plugins: com.herbert.george.flutter-snippets (2.0.0-stable-1), Dart (211.7817), org.jetbrains.kotlin (211-1.6.21-release-334-AS7442.40), org.intellij.plugins.markdown (211.7142.37)

通过翻译可以知道:pluginManagement{}块必须出现在脚本中任何其他语句之前

正确如下:

pluginManagement {
    repositories {
        gradlePluginPortal()
        mavenCentral()
        //Jetpack
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
    }
}

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        mavenCentral()
        ...省略
   
    }
}

rootProject.name = "IMultimedia"
include ':app'

错误原因是

我把 rootProject.name = "IMultimedia  " include ':app' 语句放到pluginManagement{}方法上面导致报错。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

PYB3

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值