android 依赖项版本问题

vuv7lop3  于 2023-03-21  发布在  Android
关注(0)|答案(3)|浏览(262)

我在Android Studio中编译项目时遇到了这个问题:

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

     :app is currently compiled against android-32.

     Also, the maximum recommended compile SDK version for Android Gradle
     plugin 7.2.1 is 32.

     Recommended action: Update this project's version of the Android Gradle
     plugin to one that supports 33, then update this project to use
     compileSdkVerion of at least 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).

如何解决此问题?我不确定应该怎么做。

fivyi3re

fivyi3re1#

这是一个依赖关系版本对比问题,只需将appcompact和ktx替换为

implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
nkoocmlb

nkoocmlb2#

将您的compileSdktargetSdk升级到33

compileSdk 33
targetSdk 33
f3temu5u

f3temu5u3#

文件-〉项目结构-〉依赖-〉模块-〉应用-〉依赖
查找appcompat并将 * 请求版本 * 更改为1.5.1

这对我很有效。

相关问题