我正在使用Retrofit 2.0.0-beta2库进行与API的通信。直到上周五,一切正常。今天我得到这个错误:无法解析:okhttp登录拦截器
Failed to resolve: com.squareup.okhttp:logging-interceptor:2.6.0-SNAPSHOT
我不能摆脱它。我已经在网上搜索,但似乎我的gradle这个文件都正确:
的build.gradle(项目)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'http://oss.sonatype.org/content/repositories/snapshots' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
的build.gradle(APP)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.package.app"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
//(...)
}
}
dependencies {
//(...)
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.google.code.gson:gson:2.4'
compile 'com.squareup.okhttp:logging-interceptor:2.6.0-SNAPSHOT'
}
当我从依赖关系(这意味着我看不到Retrofit日志,但我确实希望看到它们)编译'com.squareup.okhttp:logging-interceptor:2.6.0-SNAPSHOT',一切工作正常。任何人都知道如何解决它?