gpt4 book ai didi

gradle - 任务 :app:checkReleaseAarMetadata FAILED react-native

转载 作者:行者123 更新时间:2023-12-05 03:38:14 24 4
gpt4 key购买 nike

我正在使用 ./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 后会中断。

编辑
我将以下行添加到我的 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"
}

关于gradle - 任务 :app:checkReleaseAarMetadata FAILED react-native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69034646/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com