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

网友投稿 2394 2022-09-01

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

【错误记录】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 工程中的 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" }}

二、解决方案

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" }}

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:详细对比php中类继承和接口继承(php是否支持多继承)
下一篇:求3000 以内的全部亲密数
相关文章

 发表评论

暂时没有评论,来抢沙发吧~