相关疑难解决方法(0)

Android 应用程序无法构建 - 在依赖项的 androidx.work:work-runtime:2.7.0-beta01 中指定的 minCompileSdk (31)

我正在尝试在我的 M1 中构建一个项目,

但当我运行时出现此错误npx react-native run-android

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> 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.work:work-runtime:2.7.0-beta01.
     AAR metadata file: /Users/macpro/.gradle/caches/transforms-3/999e9d813832e06d8f1b7de52647a502/transformed/work-runtime-2.7.0-beta01/META-INF/com/android/build/gradle/aar-metadata.properties.
Run Code Online (Sandbox Code Playgroud)

Android/build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "30.0.0"
        minSdkVersion = 21
        compileSdkVersion = …
Run Code Online (Sandbox Code Playgroud)

android gradle

53
推荐指数
5
解决办法
13万
查看次数

如何解决错误:app:checkDebugAarMetadata

我尝试按照此答案中提到的步骤添加 google_mobile_ads 版本 1.0.0:/sf/answers/4751848531/,但是当我在调试模式下运行应用程序时,出现此错误:

Execution failed for task ':app:checkDebugAarMetadata'.
> 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.work:work-runtime:2.7.0.
     AAR metadata file: /Users/mydata/.gradle/caches/transforms-2/files-2.1/6ca6bfbb6ed79157a08fdd6548cc9e4d/work-runtime-2.7.0/META-INF/com/android/build/gradle/aar-metadata.properties.
Run Code Online (Sandbox Code Playgroud)

有什么办法可以解决这个问题吗?这是 android/app/build.gradle https://gist.github.com/wahyu-handayani/025cbb7c538196cf91e6629ac668954f

android gradle flutter

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×2

gradle ×2

flutter ×1