app_plugin_loader Gradle 插件强制使用 apply 脚本方法,该方法已被弃用,并将在 flutter 的未来版本中删除错误

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

我有一个扑动应用程序。我想给出一个输出,但我给出了一些错误。请帮我。我的flutter版本是3.19....

errors :Running Gradle task 'assembleDebug'...

You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/

FAILURE: Build failed with an exception.

* What went wrong:

A problem occurred configuring root project 'android'.

> Could not resolve all files for configuration ':classpath'.

> Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.101.7.10.

Searched in the following locations:

- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.7.101.7.10/kotlin-gradle-plugin-1.7.101.7.10.pom

- https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.7.101.7.10/kotlin-gradle-plugin-1.7.101.7.10.pom

- https://artifactory.img.ly/artifactory/imgly/org/jetbrains/kotlin/kotlin-gradle-plugin/1.7.101.7.10/kotlin-gradle-plugin-1.7.101.7.10.pom

Required by:

project :

* Try:

> Run with --stacktrace option to get the stack trace.

> Run with --info or --debug option to get more log output.

> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s

Running Gradle task 'assembleDebug'...

5.4s

Gradle task assembleDebug failed with exit code 1

Process finished with exit code 1

settings.gradle

include ':app'

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"`

我尝试构建我的项目,但不幸的是我给出了一些错误......

android flutter dart gradle android-gradle-plugin
1个回答
0
投票

你搞乱了 KGP 版本: enter image description here

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