gpt4 book ai didi

android - 无法解析 : okhttp loggin-interceptor

转载 作者:太空宇宙 更新时间:2023-11-03 12:05:23 25 4
gpt4 key购买 nike

我正在使用 Retrofit 2.0.0-beta2 库与 API 进行通信。直到上周五,一切正常。今天我收到这个错误:

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(应用程序)

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'
}

当我从依赖项中删除 `compile 'com.squareup.okhttp:logging-interceptor:2.6.0-SNAPSHOT' 时(这意味着我看不到 Retrofit 日志,但我确实想看到它们) 一切正常。任何人都知道如何解决它?

最佳答案

今天 logging-interceptor 已更新至 2.6.0,您可以在 jCenter 上看到

改变你的build.gradle从

dependencies {
...
compile 'com.squareup.okhttp:logging-interceptor:2.6.0-SNAPSHOT'
}

到:

dependencies {
...
compile 'com.squareup.okhttp:logging-interceptor:2.6.0'
}

关于android - 无法解析 : okhttp loggin-interceptor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33872987/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com