发生多个任务操作失败: 执行 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: /home/arrakeen/.gradle/caches/transforms-2/files-2.1/625039eaad011f884ddd84f857a44b7f/jetified-window-java-1.0.0-beta04/META-INF/com/android/build/gradle/aar-metadata.properties.
执行 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: /home/arrakeen/.gradle/caches/transforms-2/files-2.1/a78fdf90e4c1f8464b19895cfb365f3f/jetified-window-1.0.0-beta04/META-INF/com/android/build/gradle/aar-metadata.properties.
11秒内构建失败
异常:Gradle 任务 assembleDebug 失败,退出代码为 1
您需要在
build.gradle(app) 文件中将compileSdkVersion
和 targetSdkVersion
都设置为 3
1。
android {
compileSdkVersion 31 // <-- This
defaultConfig {
applicationId "com.example.app"
targetSdkVersion 31 // <-- and this too
// ...
}
}
build.gradle(应用程序)位于项目的/app/build.gradle中。