implementation 'androidx.core:core-ktx:1.10.1'
- 在 Android 开发中,引入了 androidx.core:core-ktx:1.10.1 库后,运行项目时,出现如下错误信息
3 issues were found when checking AAR metadata:
1. Dependency 'androidx.core:core-ktx:1.10.1' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app3 is currently compiled against android-32.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 33, 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.core:core:1.10.1' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app3 is currently compiled against android-32.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 33, 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.annotation:annotation-experimental:1.3.0' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app3 is currently compiled against android-32.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 33, 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).
问题原因
引入的 androidx.core:core-ktx:1.10.1 库要求项目的 compileSdkVersion 至少为 33
而当前的 compileSdkVersion 为 32
处理策略
android {
compileSdk 33
}
implementation 'androidx.core:core-ktx:1.8.0'




