0
点赞
收藏
分享

微信扫一扫

【错误记录】Android 编译报错 ( The minCompileSdk (31) specified in a dependency‘s AAR metadata (META-INF/com )


文章目录

  • ​​一、报错信息​​
  • ​​二、解决方案​​


一、报错信息


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.appcompat:appcompat:1.4.1.
AAR metadata file: C:\Users\octop\.gradle\caches\transforms-2\files-2.1\1545d05330b91959e9302573f67dc81d\appcompat-1.4.1\META-INF\com\android\build\gradle\aar-metadata.properties.

【错误记录】Android 编译报错 ( The minCompileSdk (31) specified in a dependency‘s AAR metadata (META-INF/com )_报错信息

Android 工程中的 Module 的 build.gradle 中配置如下内容 :

android {
compileSdkVersion 30
buildToolsVersion "30.0.0"

defaultConfig {
applicationId "kim.hsl.paintgradient"
minSdkVersion 18
targetSdkVersion 30
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
}






二、解决方案


androidx.appcompat:appcompat:1.4.1 依赖库的 minCompileSdk 是

dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
}

Android 工程中的 Module 的 build.gradle 中配置修成如下即可成功编译 :

android {
compileSdkVersion 31
buildToolsVersion "31.0.0"

defaultConfig {
applicationId "kim.hsl.paintgradient"
minSdkVersion 18
targetSdkVersion 31
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
}


举报

相关推荐

0 条评论