2
0

More than 1 year has passed since last update.

Kotlin basicタイプで初回起動時にやらないとビルドエラーになること

Posted at

起きた問題

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

参考:
API レベルとバージョン対応一覧と主なトピック

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0