【发布时间】:2015-12-10 10:43:54
【问题描述】:
Volley 的依赖项似乎遇到了编译错误,我不知道为什么?这是我的依赖代码和产生的错误消息。
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
}
错误:配置项目 ':app' 时出现问题。 >
Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not resolve com.mcxiaoke.volley:library-aar:1.0.0.
Required by:
AndroidHive:app:unspecified
> Could not resolve com.mcxiaoke.volley:library-aar:1.0.0.
> Could not get resource 'https://jcenter.bintray.com/com/mcxiaoke/volley/library-aar/1.0.0/library-aar-1.0.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/mcxiaoke/volley/library-aar/1.0.0/library-aar-1.0.0.pom'.
> peer not authenticated
在尝试了新版本的 Volley 之后,我现在收到了这个编译错误:
Error:(25, 13) Failed to resolve: com.mcxiaoke.volley:library:1.0.7
完整的构建文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.george.androidhive"
minSdkVersion 8
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.mcxiaoke.volley:library:1.0.19'
}
【问题讨论】:
-
同步 Gradle 时会报错吗?
-
@Sharj 是的,我会再试一次以确保。
-
检查github.com/mcxiaoke/android-volley 以获得最新版本:
compile 'com.mcxiaoke.volley:library:1.0.19'使用这个。 -
运行重建时仍然收到“无法解决”错误消息
-
首先清理您的项目并关闭 Android Studio,然后重试。
标签: java android android-volley