起きた問題
One or more issues found when checking AAR metadata values:
こんなエラー文が表示されます。
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.core:core-ktx:1.7.0.
AAR metadata file: /***/.gradle/caches/transforms-3/43709c06b605244e4fcdef6e5a127101/transformed/jetified-core-ktx-1.7.0/META-INF/com/android/build/gradle/aar-metadata.properties.
解決策
build.gradleのcompileSdkのレベルを31までにします。
android {
compileSdk 31
defaultConfig {
applicationId "com.****.***"
minSdk 21
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}