我想在我的專案中添加 lottie 依賴項。這是lottie檔案推薦的方式
implementation "com.airbnb.android:lottie-compose:$lottieVersion"
allprojects {
repositories {
...
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}}
這是我的畢業典禮
buildscript {
ext {
compose_version = '1.1.1'
lottie_version = '0.5.4-SNAPSHOT'
}}
plugins {
id 'com.android.application' version '7.1.1' apply false
id 'com.android.library' version '7.1.1' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false}
task clean(type: Delete) {
delete rootProject.buildDir}
如您所見allProjects,我的gradle中沒有。
如何添加 Maven 存盤庫?
uj5u.com熱心網友回復:
轉到您的build.gradle 模塊和內部依賴項部分添加
implementation "com.airbnb.android:lottie-compose:$lottieVersion"
現在進入settings.gradle和里面的dependencyResolutionManagement -> repositories添加這個
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/445975.html
上一篇:如何使用gradle運行某些任務
