Gradle 同步失败:找不到 com.google.http-client:google-http-client-parent:1.24.1。在以下位置搜索:
Gradle sync failed: Could not find com.google.http-client:google-http-client-parent:1.24.1. Searched in the following locations:
我正在尝试使用 Gradle 3.1.3 构建项目,所以我在几分钟前收到此错误,我没有添加任何新的依赖项或库以及我的 Android Studio 版本是 3.1.3
同步错误:
无法找到 com.google.http-客户端:google-http-客户端-父级: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-项目
// 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'
Problem resolved I have downgraded google-api-client-gson with 1.23.0
implementation 'com.google.api-client:google-api-client-gson:1.23.0'
Thanks!
我正在尝试使用 Gradle 3.1.3 构建项目,所以我在几分钟前收到此错误,我没有添加任何新的依赖项或库以及我的 Android Studio 版本是 3.1.3
同步错误:
无法找到 com.google.http-客户端:google-http-客户端-父级: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-项目
// 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'
Problem resolved I have downgraded google-api-client-gson with 1.23.0 implementation 'com.google.api-client:google-api-client-gson:1.23.0' Thanks!