Android Studio踩坑记录

一、5 issues were found when checking AAR metadata:    1.  Dependency 'androidx.appcompat:appcompat-resources:1.7.0' requires libraries and applications that       depend on it to compile against version 34 or later of the       Android APIs.

诸如此类的问题

版本问题,我改了两个地方:


1、在build.gradle下方的dependencies

dependencies {

implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

这里面的模块太新,所以需要降一降版本,把androidx.appcompat:appcompat降到1.6.0它就能编译通了

2、在File->Project Structrue中把Android Gradle Plugin Version 改成8.0.0:

这样配置文件生成的时候依赖也不会有问题

 

这样调完这两个选项之后编译就能通过了。


posted @ 2024-06-03 09:20  Thaudmin  阅读(524)  评论(0)    收藏  举报