8 issues were found when checking AAR metadata:

文章目录

8 issues were found when checking AAR metadata:

1.问题描述

8 issues were found when checking AAR metadata:

  1. Dependency 'androidx.activity:activity:1.13.0' requires libraries and applications that

    depend on it to compile against version 36 or later of the

    Android APIs.

    : app is currently compiled against android-35.

    Also, the maximum recommended compile SDK version for Android Gradle

    plugin 8.8.0 is 35.

    Recommended action: Update this project's version of the Android Gradle

    plugin to one that supports 36, then update this project to use

    compileSdk of at least 36.

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

  2. Dependency 'androidx.activity:activity:1.13.0' requires Android Gradle plugin 8.9.1 or higher.

    This build currently uses Android Gradle plugin 8.8.0.

  3. Dependency 'androidx.core:core:1.18.0' requires libraries and applications that

    depend on it to compile against version 36 or later of the

    Android APIs.

    : app is currently compiled against android-35.

    Also, the maximum recommended compile SDK version for Android Gradle

    plugin 8.8.0 is 35.

    Recommended action: Update this project's version of the Android Gradle

    plugin to one that supports 36, then update this project to use

    compileSdk of at least 36.

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

  4. Dependency 'androidx.core:core:1.18.0' requires Android Gradle plugin 8.9.1 or higher.

    This build currently uses Android Gradle plugin 8.8.0.

  5. Dependency 'androidx.core:core-ktx:1.18.0' requires libraries and applications that

    depend on it to compile against version 36 or later of the

    Android APIs.

    : app is currently compiled against android-35.

    Also, the maximum recommended compile SDK version for Android Gradle

    plugin 8.8.0 is 35.

    Recommended action: Update this project's version of the Android Gradle

    plugin to one that supports 36, then update this project to use

    compileSdk of at least 36.

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

  6. Dependency 'androidx.core:core-ktx:1.18.0' requires Android Gradle plugin 8.9.1 or higher.

    This build currently uses Android Gradle plugin 8.8.0.

  7. Dependency 'androidx.navigationevent:navigationevent-android:1.0.0' requires libraries and applications that

    depend on it to compile against version 36 or later of the

    Android APIs.

    : app is currently compiled against android-35.

    Also, the maximum recommended compile SDK version for Android Gradle

    plugin 8.8.0 is 35.

    Recommended action: Update this project's version of the Android Gradle

    plugin to one that supports 36, then update this project to use

    compileSdk of at least 36.

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

  8. Dependency 'androidx.navigationevent:navigationevent-android:1.0.0' requires Android Gradle plugin 8.9.1 or higher.

    This build currently uses Android Gradle plugin 8.8.0.

2.解决办法

上述问题的根本原因是依赖库之间的版本存在冲突。解决办法有两种,一种是升级 agp 的版本,但是本人当前在学习阶段,为了与资料保持一致性,故没有选择升级 agp。所以进行了依赖库的降级,修改位置如下所示:

  • 升级 compileSdk 为 36

  • 降级依赖库版本

成功解决🤗

相关推荐
逐光老顽童1 天前
Java 与 Kotlin 混合开发避坑指南:30 个真实案例实录
android·kotlin
爱勇宝2 天前
鸿蒙生态的下半场:开发者不只要能开发,还要能赚钱
android·前端·程序员
Yeyu2 天前
刷新一帧的艺术:invalidate / postInvalidate / postInvalidateOnAnimation全解析
android
潘潘潘2 天前
Android OTA 升级原理和流程介绍
android
plainGeekDev2 天前
null 判断 → Kotlin 可空类型
android·java·kotlin
plainGeekDev2 天前
getter/setter → Kotlin 属性
android·java·kotlin
YXL1111YXL2 天前
Handler 消息回收与协程异步执行的时序陷阱
android
恋猫de小郭2 天前
KMP / CMP 鸿蒙版本 Beta 发布,他有什么特别之处?
android·前端·flutter
三少爷的鞋2 天前
Android 协程并发控制:别动线程池,控制好并发语义就够了
android
weiggle3 天前
第七篇:状态提升与单向数据流——架构设计的核心
android