如何在Android Studio中解决这个错误

huangapple go评论80阅读模式
英文:

How do I solve this error in Android Studio

问题

6个问题在检查AAR元数据时被发现:

  1. 依赖 'androidx.appcompat:appcompat-resources:1.6.0' 需要编译依赖于它的库和应用程序针对Android API的版本33或更高进行编译。
    :app 目前是针对android-32进行编译的。
    推荐操作:更新此项目以使用至少33的新编译SDK版本,例如33。
    请注意,更新库或应用程序的编译SDK版本(允许使用新的API)可以与更新目标SDK版本(选择应用程序的新运行时行为)和最低SDK版本(确定应用程序可安装在哪些设备上)分开进行。

  2. 依赖 'androidx.appcompat:appcompat:1.6.0' 需要编译依赖于它的库和应用程序针对Android API的版本33或更高进行编译。
    :app 目前是针对android-32进行编译的。
    推荐操作:更新此项目以使用至少33的新编译SDK版本,例如33。
    请注意,更新库或应用程序的编译SDK版本(允许使用新的API)可以与更新目标SDK版本(选择应用程序的新运行时行为)和最低SDK版本(确定应用程序可安装在哪些设备上)分开进行。

  3. 依赖 'androidx.activity:activity:1.6.0' 需要编译依赖于它的库和应用程序针对Android API的版本33或更高进行编译。
    :app 目前是针对android-32进行编译的。
    推荐操作:更新此项目以使用至少33的新编译SDK版本,例如33。
    请注意,更新库或应用程序的编译SDK版本(允许使用新的API)可以与更新目标SDK版本(选择应用程序的新运行时行为)和最低SDK版本(确定应用程序可安装在哪些设备上)分开进行。

  4. 依赖 'androidx.core:core:1.9.0' 需要编译依赖于它的库和应用程序针对Android API的版本33或更高进行编译。
    :app 目前是针对android-32进行编译的。
    推荐操作:更新此项目以使用至少33的新编译SDK版本,例如33。
    请注意,更新库或应用程序的编译SDK版本(允许使用新的API)可以与更新目标SDK版本(选择应用程序的新运行时行为)和最低SDK版本(确定应用程序可安装在哪些设备上)分开进行。

  5. 依赖 'androidx.core:core-ktx:1.9.0' 需要编译依赖于它的库和应用程序针对Android API的版本33或更高进行编译。
    :app 目前是针对android-32进行编译的。
    推荐操作:更新此项目以使用至少33的新编译SDK版本,例如33。
    请注意,更新库或应用程序的编译SDK版本(允许使用新的API)可以与更新目标SDK版本(选择应用程序的新运行时行为)和最低SDK版本(确定应用程序可安装在哪些设备上)分开进行。

  6. 依赖 'androidx.annotation:annotation-experimental:1.3.0' 需要编译依赖于它的库和应用程序针对Android API的版本33或更高进行编译。
    :app 目前是针对android-32进行编译的。
    推荐操作:更新此项目以使用至少33的新编译SDK版本,例如33。
    请注意,更新库或应用程序的编译SDK版本(允许使用新的API)可以与更新目标SDK版本(选择应用程序的新运行时行为)和最低SDK版本(确定应用程序可安装在哪些设备上)分开进行。

英文:

6 issues were found when checking AAR metadata:

  1. Dependency 'androidx.appcompat:appcompat-resources:1.6.0' 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.

    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.appcompat:appcompat:1.6.0' 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.

    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.activity:activity:1.6.0' 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.

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

  4. Dependency 'androidx.core:core:1.9.0' 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.

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

  5. Dependency 'androidx.core:core-ktx:1.9.0' 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.

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

  6. 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.

    :app 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).

I was trying to run a code

答案1

得分: 1

将您的编译SDK和目标SDK从32升级到33,或将您的 'androidx.appcompat:appcompat' 库版本从1.6.0更改为1.5.1。

英文:

Upgrade your compile Sdk and target Sdk 32 to 33 Or change your 'androidx.appcompat:appcompat' library version from 1.6.0 to 1.5.1.

答案2

得分: 0

在你的项目目录中前往:
Gradle 脚本 > build.gradle(模块:___)

android {

    compileSdk 32  **(->  32 修改为 33)**

    ...
}
英文:

In your project directory go to :
Gradle Scripts > build.gradle(Module : ___)

android {

    compileSdk 32  **(-> Change 32 to 33)**

    ...
}

答案3

得分: 0

前往:文件 -> 项目结构 -> 模块:

属性 -> 编译 SDK 版本 -> 33:

默认配置 -> 目标 SDK 版本 -> 33。

英文:

Go to: File -> Project Structure -> Modules:

Properties -> Compile Sdk Version -> 33:

Default Config -> Target SDK Version - > 33.

huangapple
  • 本文由 发表于 2023年2月18日 08:53:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/75490480.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定