拔弹性错误:执行任务失败':app:checkdebugaarmetadata'

发布于 2025-01-23 23:32:12 字数 1739 浏览 0 评论 0 原文

这是我的Android/build.gradle代码Android Mobile应用程序。但是我在这里有一个错误。我什么都不了解。你能帮我吗?

build.gradle

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}

失败:构建失败,有例外。

  • 出了什么问题: 执行失败的任务':app:checkdebugaarmetadata'。

发生多个任务动作失败: 执行com.android.build.gradle.internal.tasks.checkaarmetadataworkaction时发生故障 > Mincompilesdk(31)在 依赖项的AAR元数据(Meta-Inf/com/android/build/gradle/aar-metadata.properties) 大于该模块的CompileSdkversion(Android-30)。 依赖项:androidx.window:window-java:1.0.0-beta04。 aar metadata文件:c:\ users \ berfi.gradle \ caches \ transforms-2 \ first-2.1 \ 5695D8D932D545AF38BF66B725566D02 \ -metadata.properties。 执行com.android.build.gradle.internal.tasks.checkaarmetadataworkorcation时发生故障 > Mincompilesdk(31)在 依赖项的AAR元数据(Meta-Inf/com/android/build/gradle/aar-metadata.properties) 大于该模块的CompileSdkversion(Android-30)。 依赖项:androidx.window:窗口:1.0.0-beta04。 aar metadata文件:c:\ users \ berfi.gradle \ caches \ transforms-2 \ files-2 \ files-2.1 \ e4e324fde2799cc82a9b6d2e3e16efc2 .properties。

  • 尝试: 使用-StackTrace选项运行以获取堆栈跟踪。使用-Info或 - debug选项运行,以获取更多日志输出。运行 - 扫描以获得完整的见解。

This is my android/build.gradle code from city travel guide android mobile application. But I have an error for here. I don't understand anything. Can you help me for this?

build.gradle

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:checkDebugAarMetadata'.

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).
Dependency: androidx.window:window-java:1.0.0-beta04.
AAR metadata file: C:\Users\berfi.gradle\caches\transforms-2\files-2.1\5695d8d932d545af38bf66b725566d02\jetified-window-java-1.0.0-beta04\META-INF\com\android\build\gradle\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).
Dependency: androidx.window:window:1.0.0-beta04.
AAR metadata file: C:\Users\berfi.gradle\caches\transforms-2\files-2.1\e4e324fde2799cc82a9b6d2e3e16efc2\jetified-window-1.0.0-beta04\META-INF\com\android\build\gradle\aar-metadata.properties.

  • 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
    BU�LD FAILED in 2m 56s
    Exception: Gradle task assembleDebug failed with exit code 1
    Exited (sigterm)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娇女薄笑 2025-01-30 23:32:12

有两个 build.gradle 文件。一个在root android/文件夹中,一个在 android/app/文件夹中。

从错误中了解 build.gradle file android/app/build.gradle ,然后更改31的 mincompilesdk 的值到30。默认值可以为 flutter.compilesdkversion 在这种情况下,也可以做同样的事情。用30替换它的

错误是“依赖关系中指定的MinCompilesdk(31)(31)(Meta-Inf/com/android/android/build/gradle/aar-metadata.properties)大于该模块的CompileSdkversion(Android-30) 。”

因此,我假设将其从31更改为30应该解决您的错误。尝试一下。

There are two build.gradle files. One in the root android/ folder and one in android/app/ folder.

From what I understand from the error go to build.gradle file inside android/app/build.gradle and change the value of minCompileSdk from 31 to 30. The default value could be flutter.compileSdkVersion in that case, do the same. Replace it with 30

The error is that "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)."

So I'm assuming changing it from 31 to 30 should fix your error. Give it a try.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文