Gradle 核心插件(插件不在“org.gradle”命名空间中)

问题描述 投票:0回答:2

导致此构建错误的原因:


- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.android.application:com.android.application.gradle.plugin:7.0.3')
  Searched in the following repositories:
    Gradle Central Plugin Repository
    Google

在 build.gradle 文件中

期待 Android 构建成功

android android-studio gradle android-gradle-plugin build.gradle
2个回答
3
投票

就我而言,

settings.gradle
文件丢失。您可以创建一个文件并将其放入项目根文件夹中。

settings.gradle

pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}
rootProject.name = "android-geocode"
include ':app'

0
投票

检查distributionurl的gradle-wrapper属性版本,它应该与build.gradle的插件版本相同

© www.soinside.com 2019 - 2024. All rights reserved.