Android Studio踩坑記錄

Thaudmin發表於2024-06-03

一、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:

這樣配置檔案生成的時候依賴也不會有問題

這樣調完這兩個選項之後編譯就能透過了。


相關文章