我已经应用了互联网上可用的大部分方法,但仍然出现相同的错误。更新了gradle版本。其次,我也在终端中尝试了两个 Maven 链接,但仍然出现相同的错误。我还添加了 google maven 存储库。
buildscript {
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
apply plugin: 'com.android.library'
repositories {
jcenter()
google()
}
android {
compileSdkVersion 25
buildToolsVersion "24.0.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 25
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
lintOptions {
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
dependencies {
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp3:okhttp:3.5.0'
compile 'com.squareup:otto:1.3.8'
compile 'com.squareup.dagger:dagger:1.2.5'
compile 'com.google.guava:guava:20.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.jakewharton.retrofit:retrofit1-okhttp3-client:1.1.0'
compile fileTree(dir: 'libs', include: '*.jar')
}