Import dependency google-api-client

Asked

Viewed 167 times

1

Good morning!

I’m trying to matter google-api-java-client of github for my Android project;

I’m using the AndroidStudio, and follow my build.Lade

apply plugin: 'com.android.application'
apply plugin: 'maven'
android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0 rc3"

    defaultConfig {
        applicationId "br.com.meu.projeto"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
repositories {
    mavenCentral()
}

dependencies {

    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.google.android.gms:play-services:7.5.0'
    compile 'com.google.code.gson:gson:2.2.+'
    compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
    compile 'com.google.api-client:google-api-client:1.19.1'
}

All other libraries are normally available except the google-api-client. I can’t import classes with GoogleAccountCredential.

Does anyone know the right way to import?

Thanks in advance!

  • Hello, try this, Compile 'com.google.api-client:google-api-client:1.20.0'

  • It didn’t work either! Thanks anyway!

1 answer

1

For my projects I use a number of libraries. Some of these may not be necessary in your project, try adding in your Radle.app:

implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.google.android.gms:play-services-drive:15.0.1'    
implementation 'com.google.apis:google-api-services-sqladmin:v1beta4-rev62-1.25.0'
implementation group:'io.grpc', name: 'grpc-okhttp', version: '1.14.0'
implementation 'com.google.oauth-client:google-oauth-client-jetty:1.23.0'
implementation 'com.google.oauth-client:google-oauth-client-java6:1.23.0'
implementation('com.google.api-client:google-api-client:1.23.0') 
{
    exclude group: 'com.google.guava', module: 'guava-jdk5'
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.