androidandroid-studiogradlebuild.gradleandroidhttpclient

Gradle sync failed: Could not find com.google.http-client:google-http-client-parent:1.24.1. Searched in the following locations:


I'm trying to build project with Gradle 3.1.3 so I'm getting this error from few minutes ago, I have nothing added new Dependancies or Librabries and My Android Studio version is 3.1.3

Gradle sync failed

Sync error:

Could not find com.google.http-client:google-http-client-parent:1.24.1. Searched in the following locations:

Log:

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- Module

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'

Solution

  • 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!