我正在使用Android Studio 2.2.3
我在使用okhttp时遇到了麻烦,而且它一直在给我:
Error:(49, 13) Failed to resolve: com.squareup.okhttp3:okhttp:3.2.0
即使我尝试导入它,错误也会显示在该行下面。
这是gradle:
apply plugin: 'com.android.application'
android {
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
compileSdkVersion 25
buildToolsVersion "25.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.example.yara.prototype"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.firebase:firebase-client-android:2.5.0'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-crash:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.android.support:design:25.0.1'
testCompile 'junit:junit:4.12'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
}
repositories {
jcenter()
maven { url "https://jitpack.io" }
mavenCentral()
}
apply plugin: 'com.google.gms.google-services'