vab
vab

Reputation: 723

Gradle build failing for Google Cloud Module

I created a project with Google cloud Module. While building I was peer not authenticated error.

Next I replaced jcenter with mavenCentral() and was able to download and add appengine-sdk, appengine-endpoints,appengine-endpoints-dep.

After doing all this build is failling with the following error message.

Error:Failed to resolve: com.google.api-client:google-api-client-android:1.19.0

Stuck at this point. Please help on this issue

Thanks in advance

    buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.google.appengine:gradle-appengine-plugin:1.9.18'
}

}

repositories {
mavenCentral();
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.18'
compile 'com.google.appengine:appengine-endpoints:1.9.18'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.18'
compile 'javax.servlet:servlet-api:2.5'
}

appengine {
downloadSdk = true
appcfg {
    oauth2 = true
}
endpoints {
    getClientLibsOnBuild = true
    getDiscoveryDocsOnBuild = true
}

}

Upvotes: 0

Views: 1401

Answers (1)

Tim
Tim

Reputation: 43334

Next I replaced jcenter with mavenCentral()

I don't know why you did that. Jcenter is a superset of mavenCentral which basically means it can do the same, and more.

The peer authentication error you name in the comments should be solved with this solution and then you can proceed normally.

Below is a minimal working setup in order to sync google-api-client-android:1.19.0:

Project build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

App build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    defaultConfig {
        applicationId "xxxx"
        minSdkVersion 18
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.google.api-client:google-api-client-android:1.19.0'
}

You need not have the same values in the android{ } part, but the rest is important.

Also note there is a newer version of google-api-client-android, namely 1.20.0

Upvotes: 1

Related Questions