任务:app:checkReleaseAarMetadata 失败反应本机

2023-12-03

我正在为我的项目制作一个发布版本./gradlew assembleRelease命令,但它给了我这个错误。

> Task :app:checkReleaseAarMetadata FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkReleaseAarMetadata'.
> 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.core:core:1.7.0-alpha02.
     AAR metadata file: /Users/classic/.gradle/caches/transforms-2/files-2.1/64ba04558e5775ef86bc1e2e88b04a01/core-1.7.0-alpha02/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.

我无法编辑我的build.gradle用于修复此错误,因为项目有一些依赖项在更改后会中断compileSdkVersion.

Edit
我将以下行添加到我的android/app/build.gradle但这对我不起作用。

implementation "androidx.core:core-ktx:1.6.0"

相关问题->here


最后我通过添加以下行来修复此错误android/build.gradle.

buildscript {
    ext {
        androidXCore = "1.6.0" // <-- Add this line
        buildToolsVersion = "29.0.3"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 29
        ndkVersion = "20.1.5948944"
    }
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

任务:app:checkReleaseAarMetadata 失败反应本机 的相关文章

随机推荐