Import dependency google-api-client

1

Good morning!

I'm trying to import google-api-java-client from github to my Android project ;

I'm using AndroidStudio , and follow my build.glade

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 usually available, except for google-api-client. I can not import classes with GoogleAccountCredential .

Does anyone know the right way to import?

Thank you in advance!

    
asked by anonymous 12.08.2015 / 15:19

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 gradle.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'
}
    
19.09.2018 / 18:57