首页 > 解决方案 > 将 Lottie 库添加到 Android Studio 项目中给了我这个:“无法解决依赖关系”

问题描述

我正在尝试使用以下行将 Lottie 库添加到我的 Android 项目中:

implementation 'com.airbnb.android:lottie:2.5.0'

& 同步后显示此错误:

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.airbnb.android:lottie:2.5.0.

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.airbnb.android:lottie:2.5.0.

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.airbnb.android:lottie:2.5.0.

Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.airbnb.android:lottie:2.5.0.

我也尝试添加其他 Lottie 版本,但仍然显示相同的错误。我正在使用 Android Studio 3.2 和目标 SDK 是 28。请帮助我如何解决这个问题。

标签: androidgradleandroid-gradle-plugin

解决方案


普通的 2.5 版本似乎不存在(根据他们的Github repo

使用 2.7 代替:

implementation 'com.airbnb.android:lottie:2.7.0'

推荐阅读