You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio无法安装Compose外特定依赖包,报错CheckDebugAarMetadata

解决CheckDebugAarMetadata依赖报错的方案

1. 替换为Compose适配版依赖

你当前用的Lottie是原生Android版本,并非Compose专用,容易出现兼容性冲突:

  • 替换Lottie依赖为Compose适配版本:
    implementation "com.airbnb.android:Lottie-compose:6.4.0"
    
  • 升级Meow Bottom Navigation到最新稳定版,提升兼容性:
    implementation "com.etebarian:meow-bottom-navigation:2.0.1"
    

2. 统一项目SDK版本

确保模块级build.gradle里的Compile SDK和Target SDK与依赖要求对齐,示例配置:

android {
    compileSdk 34
    defaultConfig {
        targetSdk 34
        minSdk 21 // 根据你的项目需求调整
    }
}

3. 对齐Kotlin与AGP版本

Kotlin版本必须和Android Gradle Plugin(AGP)版本匹配,示例配置(项目级build.gradle):

plugins {
    id 'com.android.application' version '8.2.0' apply false
    id 'org.jetbrains.kotlin.android' version '1.9.20' apply false
}

参考匹配规则:AGP 8.0+ 对应 Kotlin 1.8.20+;AGP 7.4.x 对应 Kotlin 1.8.x

4. 检查仓库配置

确认settings.gradle中包含Maven Central仓库(两个依赖均托管在此):

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}

5. 清理缓存并重建

  • 通过Android Studio菜单执行:File > Invalidate Caches... > Invalidate and Restart
  • 或终端执行命令强制刷新依赖:
    ./gradlew clean build --refresh-dependencies
    

若以上操作仍未解决问题,需提供完整的报错日志(包括冲突的依赖模块、版本不匹配细节),以便进一步定位。

内容的提问来源于stack exchange,提问作者Opeoluwa-Muritala

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.10 06:46:05