简体   繁体   English

我想要 android12 中的启动画面,但我有来自 sdk 版本的错误

[英]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) CompileSdk,targetSdk 使用 32。然后,要使用 SplashScreen API 迁移,我必须使用 sdk 31。这个, 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)所以我把sdk版本降到了31,但是报错了。(检查AAR元数据时发现了4个问题)

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) build.gradle(:应用程序)

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.这是我的依赖项,我将“androidx.appcompat:appcompat:1.5.0”更改为 1.4.0。 But it still does not work.但它仍然不起作用。 What should I do?我应该怎么办? please..请..

Thank you for reading my question.感谢您阅读我的问题。 Have a nice day!祝你今天过得愉快!

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:所以在你的 build.grade(:app) 而不是这个: 在此处输入图像描述

Simply do change it to this:只需将其更改为: 在此处输入图像描述

It should work fine and make sure to upgrade your all dependencies它应该可以正常工作并确保升级所有依赖项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM