我正在尝试使用Gradle 3.1.3构建项目,所以几分钟前我收到了此错误,我没有添加任何新的依赖项或库,并且我的Android Studio版本是3.1.3
同步错误:
找不到com.google.http-client:google-http-client-parent:1.24.1。 在以下位置搜索:
日志:
file:/D:/Android-SDK/extras/m2repository/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.pom
file:/D:/Android-SDK/extras/m2repository/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.jar
file:/D:/Android-SDK/extras/google/m2repository/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.pom
file:/D:/Android-SDK/extras/google/m2repository/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.jar
file:/D:/Android-SDK/extras/android/m2repository/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.pom
file:/D:/Android-SDK/extras/android/m2repository/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.jar
https://dl.google.com/dl/android/maven2/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.pom
https://dl.google.com/dl/android/maven2/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.jar
https://jcenter.bintray.com/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.pom
https://jcenter.bintray.com/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.jar
https://maven.google.com/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.pom
https://maven.google.com/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.jar
build.gradle-Project
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.3.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle-模块
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.credibleecs.qeran"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
useLibrary 'org.apache.http.legacy'
vectorDrawables.useSupportLibrary = true
lintOptions
{
checkReleaseBuilds false
// 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
}
}
buildTypes {
debug {}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
//noinspection GradleCompatible
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:support-vector-drawable:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:percent:26.1.0'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.android.support:exifinterface:26.1.0'
implementation 'com.google.api-client:google-api-client-gson:+'
implementation 'com.android.volley:volley:1.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.android.volley:volley:1.0.0'
implementation 'com.firebase:firebase-client-android:2.5.2+'
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.google.firebase:firebase-core:15.0.2'
implementation 'com.google.firebase:firebase-database:15.0.0'
implementation 'com.google.firebase:firebase-storage:15.0.0'
testImplementation 'junit:junit:4.12'
implementation project(':paytabs-android-SDK-v2.5')
implementation 'io.card:android-sdk:5.3.0'
}
apply plugin: 'com.google.gms.google-services'
答案 0 :(得分:0)
问题已解决,我已将google-api-client-gson降级为1.23.0 实施'com.google.api-client:google-api-client-gson:1.23.0' 谢谢!