问题

An issue was found when checking AAR metadata:

  1. Dependency 'androidx.activity:activity:1.8.0' requires libraries and applications that
    depend on it to compile against version 34 or later of the
    Android APIs.

    :app is currently compiled against android-33.

    Recommended action: Update this project to use a newer compileSdk
    of at least 34, for example 34.

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

对于上述报错的翻译

检查AAR元数据时发现一个问题:

1.依赖项“androidx.activity:activity:1.8.0”要求库和应用程序

依赖它来编译的版本34或更高版本

Android API。

:该应用程序目前是针对android-33编译的。

建议操作:更新此项目以使用更新的compileSdk

例如34。

请注意,更新库或应用程序的compileSdk(

允许使用更新的API)可以与更新分开进行

targetSdk(将应用程序选择为新的运行时行为)和

minSdk(用于确定应用程序可以安装的设备

on)。

解决办法

因此只需要对gradle的配置文件进行修改

image.png

打开红框文件

image.png

将其的33修改为34(图片已经修改过了)

如果你在修改完成以后无法运行软件到虚拟机 不要忘记进行sycn

结语

Android开发真奇妙

Last modification:October 10, 2023
If you think my article is useful to you, please feel free to appreciate