提问人:Garvit 提问时间:9/22/2023 更新时间:10/2/2023 访问量:213
在添加 GitHub 库和依赖项时遇到问题
Facing issues in adding GitHub libraries and dependencies
问:
我无法将许多 github 库添加到我的项目中。例如,现在我想添加io.alterac.blurkit:blurkit:1.1.0,但它一直说无法解决:io.alterac.blurkit:blurkit:1.1.0。我已经检查了我的 gradle 离线按钮,它是在线的
这是我的build.gradle
buildscript {
dependencies {
classpath 'com.google.gms:google-services:4.4.0'
}
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
jcenter()
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.4.2' apply false
id 'com.android.library' version '7.4.2' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是我的settings.gradle
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven { url 'https://jitpack.io' }
}
}
rootProject.name = "Radiant"
include ':app'
我已经尝试了我所知道的所有可能的方法,但它不起作用
我尝试在我的 settings.gradle 和 build.gradle 中添加 maven { url 'https://jitpack.io' },但没有用
答:
1赞
Yuhn1m
10/2/2023
#1
该库发布在 Jcenter 上,似乎 Jcenter 已关闭。我从这里检查:https://mvnrepository.com/artifact/io.alterac.blurkit/blurkit/1.1.1
我最近遇到了这个错误,要修复它,只需下载源代码并导入其模块“blurkit”https://github.com/CameraKit/blurkit-android
并请重新配置模块的 build.gradle 和 delelte deploy.gradle。对我来说一切都很好。
评论