简体   繁体   English

将我的 flutter 版本更新到最新版本 (2.10) 后出现此错误

[英]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。

  • What went wrong: Execution failed for task ':app:checkReleaseAarMetadata'.出了什么问题:任务“:app:checkReleaseAarMetadata”执行失败。

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.orghttps://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.

相关问题 升级到最新版本后出现颤振错误 - Flutter Error after upgrade to latest version 我更新了我的颤振版本 破坏颤振应用程序时出错 - i update my flutter version Error in ruining flutter app 任务“:app:compileDebugKotlin”执行失败。 升级到2.10版本后报错Flutter - Execution failed for task ':app:compileDebugKotlin'. error in Flutter after upgrading to 2.10 version 我的flutter项目升级到最新版本后出现AndroidManifest.xml错误 - AndroidManifest.xml error after upgrading to the latest version in my flutter project 如何强制用户将 flutter 应用程序更新到最新版本? - How can I force user to update the flutter app to latest version? 升级到最新的 Flutter 稳定版本后 CachedNetworkImage 抛出错误 - CachedNetworkImage throwing error after upgrading to latest Flutter Stable version 更新 Flutter 到最新版本后的错误 - Errors after updating Flutter to the latest version 从当前版本升级到最新版本时出现错误 - Error in upgrade flutter from current version to latest ext.kotlin_version = <'latest version'> Flutter 错误 - ext.kotlin_version = <'latest version'> error on Flutter which Local relational Data Base for Flutter windows app 2.10稳定版后。 应该使用? - which Local relational Data Base for Flutter windows app after 2.10 stable version. Should Use?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM