[英]I get this error after update my flutter version to latest version (2.10)
Guys please help me i can't build or upgrade anything in flutter and i get alot of errors like that FAILURE: Build failed with an exception.伙计们请帮助我,我无法在 flutter 中构建或升级任何东西,并且我遇到了很多错误,例如 FAILURE: Build failed with an exception。
Multiple task action failures occurred: A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction > The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-30).
Multiple task action failures occurred: A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction > The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata .properties) 大于此模块的 compileSdkVersion (android-30)。 Dependency: androidx.window:window-java:1.0.0-beta04.
依赖:androidx.window:window-java:1.0.0-beta04。 AAR metadata file: C:\Users\Carnival.gradle\caches\transforms-2\files-2.1\625039eaad011f884ddd84f857a44b7f\jetified-window-java-1.0.0-beta04\META-INF\com\android\build\gradle
AAR 元数据文件:C:\Users\Carnival.gradle\caches\transforms-2\files-2.1\625039eaad011f884ddd84f857a44b7f\jetified-window-java-1.0.0-beta04\META-INF\com\android\build\gradle
aar-metadata.properties.aar-metadata.properties。 A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction > The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-30).
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction > The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than这个模块的 compileSdkVersion (android-30)。 Dependency: androidx.window:window:1.0.0-beta04.
依赖:androidx.window:window:1.0.0-beta04。 AAR metadata file: C:\Users\Carnival.gradle\caches\transforms-2\files-2.1\a78fdf90e4c1f8464b19895cfb365f3f\jetified-window-1.0.0-beta04\META-INF\com\android\build\gradle\aar-m etadata.properties.
AAR 元数据文件:C:\Users\Carnival.gradle\caches\transforms-2\files-2.1\a78fdf90e4c1f8464b19895cfb365f3f\jetified-window-1.0.0-beta04\META-INF\com\android\build\gradle\元数据.properties。
Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.
使用 --info 或 --debug 选项运行以获得更多日志 output。 Run with --scan to get full insights.
运行 --scan 以获得完整的见解。
Get more help at https://help.gradle.org在https://help.gradle.org获得更多帮助
change the compileSdkVersion and targetSdkVersion in build.gradle file.更改 build.gradle 文件中的 compileSdkVersion 和 targetSdkVersion。
(YourAppName\android\build.gradle).
compileSdkVersion from 29 to 30 compileSdkVersion从 29 到 30
targetSdkVersion from 29 to 30 targetSdkVersion从 29 到 30
If you're already in version 30 then check yourappname/android/build.gradle has these repositories or not如果您已经在版本 30 中,请检查 yourappname/android/build.gradle 是否有这些存储库
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}allprojects {
repositories {
google()
jcenter()
}}rootProject.buildDir = '../build'subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')}task clean(type: Delete) {
delete rootProject.buildDir}
This above code is not beautiful as StackOverflow is not able to take build.gradle file上面的代码并不漂亮,因为 StackOverflow 无法获取 build.gradle 文件
30 might also fail so just bump it up to 31 also, the ext.kotlin_version might also cause problems after the above change and will need the latest version which is 1.6.10 . 30 也可能会失败,所以只需将其提升到 31, ext.kotlin_version也可能在上述更改后引起问题,并且需要最新版本,即1.6.10 。 However, implement the changes as necessary.
但是,根据需要实施更改。 If changing the SdkVersion alone solves your problem, call it a win.
如果仅更改 SdkVersion 就可以解决您的问题,那就称其为胜利。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.