错误:在以下任何来源中均未找到插件 [id: 'com.android.application', 版本: '8.7.0', apply: false]

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

我跑步

 flutter run --release
:

  • 出了什么问题: 在以下任何来源中均未找到插件 [id: 'com.android.application', version: '8.7.0', apply: false]:
  • Gradle 核心插件(插件不在“org.gradle”命名空间中)
  • 包含的版本(没有包含的版本包含此插件)
  • 插件存储库(无法解析插件工件“com.android.application:com.android.application.gradle.plugin:8.7.0”) 在以下存储库中搜索: Maven仓库 Gradle 中央插件存储库 谷歌

MacOS 14.4(Apple Silicon)• Android Studio 2023.2.1 • Java 17 Flutter 3.19.4 • Dart 3.3.2 • DevTools 2.31.1


settings.gradle

pluginManagement {
    def flutterSdkPath = {
        def properties = new Properties()
        file("local.properties").withInputStream { properties.load(it) }
        def flutterSdkPath = properties.getProperty("flutter.sdk")
        assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
        return flutterSdkPath
    }()

    includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

    repositories {
        mavenCentral()
        gradlePluginPortal()
        google()
    }
}

plugins {
    //id "com.google.gms" version "8.7.0" apply false
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "org.jetbrains.kotlin.android" version "1.9.22" apply false
    id "com.android.application" version "8.7.0" apply false
    //id "com.android.library" version "8.7.0" apply false
}

//rootProject.buildFileName = 'build.gradle.kts'

include ":app"

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip

android/build.gradle

allprojects {
    repositories {
        mavenCentral()
        gradlePluginPortal()
        google()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
    delete rootProject.buildDir
}
flutter gradle android-gradle-plugin build.gradle gradle-plugin
1个回答
0
投票

Android Gradle 插件没有 8.7.0 版本(Google repo)。

选择最新的可用版本,8.3.1:

id "com.android.application" version "8.3.1" apply false
© www.soinside.com 2019 - 2024. All rights reserved.