文章目录
- 一、报错信息
- 二、解决方案
一、报错信息
编译 Android Studio 工程时 , 报如下错误 ;
代码语言:javascript复制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-28).
Dependency: androidx.appcompat:appcompat:1.4.1.
AAR metadata file: C:Usersoctop.gradlecachestransforms-2files-2.18e0e08f73cb1db91835eb81ec877eaf8appcompat-1.4.1META-INFcomandroidbuildgradleaar-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.
* Get more help at https://help.gradle.org
BUILD FAILED in 836ms
二、解决方案
报错时说明 androidx.appcompat:appcompat:1.4.1. 依赖库必须以 android-31 进行编译 , 这里降低该依赖库的版本到 ‘androidx.appcompat:appcompat:1.0.0’ 即可 ;