【问题标题】:how to fix this issue "Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.github.Goodiebag:PinView:v1.3."如何解决此问题“无法解决 ':app@debug/compileClasspath' 的依赖关系:无法解析 com.github.Goodiebag:PinView:v1.3。”
【发布时间】:2018-09-19 18:00:49
【问题描述】:

当我在 gradle 中添加依赖时它显示错误:

无法解析 ':app@debug/compileClasspath' 的依赖关系:无法解析 com.github.Goodiebag:PinView:v1.3。 打开文件 显示详情

无法解析 ':app@debugAndroidTest/compileClasspath' 的依赖关系:无法解析 com.github.Goodiebag:PinView:v1.3。 打开文件 显示详情

无法解析 ':app@debugUnitTest/compileClasspath' 的依赖关系:无法解析 com.github.Goodiebag:PinView:v1.3。 打开文件 显示详情

无法解析 ':app@release/compileClasspath' 的依赖关系:无法解析 com.github.Goodiebag:PinView:v1.3。 打开文件 显示详情

无法解析 ':app@releaseUnitTest/compileClasspath' 的依赖关系:无法解析 com.github.Goodiebag:PinView:v1.3。 打开文件 显示详情

我的依赖项在这里:

implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.+'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.volley:volley:1.1.1'

    implementation 'com.github.Goodiebag:PinView:v1.3'//this one is showing error

    /*implementation 'dev.dworks.libs:volleyplus:0.1.4'*/
    /*implementation 'dev.dworks.libs:volleyplus:+'*/
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

这是我的 build.gradle(项目 Cogniable)

allprojects {
    repositories {
        google()
        jcenter()
        maven{ url "https://jitpack.io" }
    }
}

【问题讨论】:

  • github.com/GoodieBag/Pinview 如果这不能解释它,请显示 build.gradle 的其余部分,显示 where 设置依赖库。
  • 我更新了我的 repos @jdv

标签: java android github sdk


【解决方案1】:
  1. 确保您的互联网连接已开启

  2. 您的 android studio 未处于离线模式

如果以上两个是正确的,那么这样做: 在您的 build.gradle(项目级别) 中添加此 maven { url "https://jitpack.io" } 在 allprojects 块下的 repositories 块下,因此您的 build.gradle allprojects 块代码应如下所示:

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

【讨论】:

  • 我的 android studio 处于离线模式,现在可以正常工作了..谢谢兄弟
猜你喜欢
  • 1970-01-01
  • 2018-12-15
  • 1970-01-01
  • 2018-08-26
  • 1970-01-01
  • 1970-01-01
  • 2022-08-15
  • 2018-04-10
  • 2018-06-26
相关资源
最近更新 更多