Roh*_*wal 4 gradle react-native
我正在使用命令为我的项目制作发布版本./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.
Run Code Online (Sandbox Code Playgroud)
我无法编辑我的build.gradle来修复此错误,因为项目有一些依赖项在更改后会中断compileSdkVersion。
编辑
我将以下行添加到我的代码中android/app/build.gradle,但这对我不起作用。
implementation "androidx.core:core-ktx:1.6.0"
Run Code Online (Sandbox Code Playgroud)
相关问题 ->这里
最后,我通过将以下行添加到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"
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10485 次 |
| 最近记录: |