marco
marco

Reputation: 1752

Android: package com.google.api.services.gmail does not exist

As by documentation: https://github.com/google/google-api-java-client

To use Gradle, add the following lines to your build.gradle file:

repositories {
    mavenCentral() } 

dependencies {
    compile 'com.google.api-client:google-api-client:1.18.0-rc' }

Done, but I get:

Error: package com.google.api.services.gmail does not exist

What could be the reason ?

Upvotes: 0

Views: 3589

Answers (2)

Ahmad Nawaz
Ahmad Nawaz

Reputation: 1148

You are adding Google API and trying to use Gmail API. That is why getting Error: package com.google.api.services.gmail does not exist.If you want to use Gmail API add Gmail API Client Library by adding compile 'com.google.apis:google-api-services-gmail:v1-rev29-1.20.0'

Ref: https://developers.google.com/api-client-library/java/apis/gmail/v1

Upvotes: 3

aorlando
aorlando

Reputation: 668

com.google.api-client:google-api-client:1.20.0

on Android Studio->Project Structure->Dependencies-> "+" you can navigate on repository declared in the gradle and choose the current version available enter image description here

Upvotes: 1

Related Questions