Search code examples
androidkotlinsdksplash-screen

I want splash screen in android12 but i have errors from sdk version


CompileSdk, targetSdk used 32. Then, to use SplashScreen API migration, i have to use sdk 31. this, build.gradle(:app)

implementation 'androidx.core:core-splashscreen:1.0.0'

So I lowered the sdk version to 31, but there was an error.(4 issues were found when checking AAR metadata)

4 issues were found when checking AAR metadata:

  1.  Dependency 'androidx.appcompat:appcompat-resources:1.5.0' requires libraries and applications that
      depend on it to compile against version 32 or later of the
      Android APIs.

      :app is currently compiled against android-31.

      Recommended action: Update this project to use a newer compileSdkVersion
      of at least 32, for example 33.

      Note that updating a library or application's compileSdkVersion (which
      allows newer APIs to be used) can be done separately from updating
      targetSdkVersion (which opts the app in to new runtime behavior) and
      minSdkVersion (which determines which devices the app can be installed
      on).

  2.  Dependency 'androidx.appcompat:appcompat:1.5.0' requires libraries and applications that
      depend on it to compile against version 32 or later of the
      Android APIs.

      :app is currently compiled against android-31.

      Recommended action: Update this project to use a newer compileSdkVersion
      of at least 32, for example 33.

      Note that updating a library or application's compileSdkVersion (which
      allows newer APIs to be used) can be done separately from updating
      targetSdkVersion (which opts the app in to new runtime behavior) and
      minSdkVersion (which determines which devices the app can be installed
      on).

  3.  Dependency 'androidx.emoji2:emoji2-views-helper:1.2.0' requires libraries and applications that
      depend on it to compile against version 32 or later of the
      Android APIs.

      :app is currently compiled against android-31.

      Recommended action: Update this project to use a newer compileSdkVersion
      of at least 32, for example 33.

      Note that updating a library or application's compileSdkVersion (which
      allows newer APIs to be used) can be done separately from updating
      targetSdkVersion (which opts the app in to new runtime behavior) and
      minSdkVersion (which determines which devices the app can be installed
      on).

  4.  Dependency 'androidx.emoji2:emoji2:1.2.0' requires libraries and applications that
      depend on it to compile against version 32 or later of the
      Android APIs.

      :app is currently compiled against android-31.

      Recommended action: Update this project to use a newer compileSdkVersion
      of at least 32, for example 33.

      Note that updating a library or application's compileSdkVersion (which
      allows newer APIs to be used) can be done separately from updating
      targetSdkVersion (which opts the app in to new runtime behavior) and
      minSdkVersion (which determines which devices the app can be installed
      on).

build.gradle(:app)

dependencies {
    def lifecycle_version = "2.5.1"

    implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"

    implementation 'androidx.core:core-ktx:1.8.0'
    implementation 'androidx.appcompat:appcompat:1.4.0'
    implementation 'com.google.android.material:material:1.7.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    // Rx
    implementation "io.reactivex.rxjava2:rxandroid:2.1.0"

    // Splash screen
    implementation 'androidx.core:core-splashscreen:1.0.0'

    // Kakao login
    implementation "com.kakao.sdk:v2-user-rx:2.11.2"
}

This is my dependencies and I changed 'androidx.appcompat:appcompat:1.5.0' to 1.4.0. But it still does not work. What should I do? please..

Thank you for reading my question. Have a nice day!


Solution

  • It does tell you how to fix it in this very line :

    Recommended action: Update this project to use a newer compileSdkVersion
    of at least 32, for example 33.
    

    So in your build.grade(:app) instead of this : enter image description here

    Simply do change it to this : enter image description here

    It should work fine and make sure to upgrade your all dependencies