依赖版本问题

问题描述 投票:0回答:4

我在 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).

如何解决这个问题?我不知道我应该做什么。

android android-studio dependencies
4个回答
2
投票

文件 -> 项目结构 -> 依赖关系 -> 模块 -> 应用程序 -> 依赖关系

找到

appcompat
并将 Requested Version 更改为
1.5.1

这对我有用。


1
投票

这是一个依赖版本对比问题,只需将您的 appcompact 和 ktx 替换为这些即可

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

1
投票

将您的

compileSdk
targetSdk
升级为
33

compileSdk 33
targetSdk 33

0
投票

当我更改为“androidx.core:core-ktx:1.8.0”和“androidx.appcompat:appcompat:1.4.2”时,我收到白名单问题

符号:类白名单 位置:类org.apache.cordova.whitelist.WhitelistPlugin

© www.soinside.com 2019 - 2024. All rights reserved.