使用compileSdk 35需要Android Gradle Plugin (AGP) 8.1.0或更高版本

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

升级 Flutter 后我们面临问题

┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────────┐
│ [!] Using compileSdk 35 requires Android Gradle Plugin (AGP) 8.1.0 or higher.                    │
│  Please upgrade to a newer AGP version. The version of AGP that your project uses is likely      │
│  defined in:                                                                                     │
│ G:\Flutter\Testing Project\test\android\settings.gradle,                                │
│ in the 'plugins' closure (by the number following "com.android.application").                    │
│  Alternatively, if your project was created with an older version of the templates, it is likely │
│ in the buildscript.dependencies closure of the top-level build.gradle:                           │
│ G:\Flutter\Testing Project\test\android\build.gradle,                                   │
│ as the number following "com.android.tools.build:gradle:".                                       │
│                                                                                                  │
│  Finally, if you have a strong reason to avoid upgrading AGP, you can temporarily lower the      │
│  compileSdk version in the following file:                                                       │
│ G:\Flutter\Testing Project\test\android\app\build.gradle                                │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

我尝试将版本 8.1 更改为 8.4 :distributionUrl=https://services.gradle.org/distributions/gradle-8.4-all.zip

但问题没有解决

flutter gradle
1个回答
0
投票

创建新的flutter应用程序并从文件中观察AGP和gradle的新版本和结构 gradle-wrapper.properties 设置.gradle 构建.gradle 应用程序/build.gradle 另外,我们不知道你的项目有多大,看看 AndroidManifest 文件

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