I am trying to develop using the Gmail API for Android for devices with API 21. In this tutorial: https://developers.google.com/gmail/api/quickstart/android It says I need to have:
Android SDK packages for API 23 or later, including the latest versions of Google Repository, Android Support Library and Google Play Services.
And the dependencies example there is:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.android.gms:play-services-auth:9.0.2'
compile 'pub.devrel:easypermissions:0.1.5'
compile('com.google.api-client:google-api-client-android:1.22.0') {
exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-gmail:v1-rev47-1.22.0') {
exclude group: 'org.apache.httpcomponents'
}
}
But I get an error when I use it saying I cant use: com.android.support:appcompat-v7:23.4.0 When my compile SDK version is 21.
I've tried changing the appcompact version to v7:21.0.2 which worked for me before, but when I sync the gradle files I get the error:
Error: Failed to resolve: com.android.support:appcompat-v7:23.1.1
Install Repository and sync project
Open File
Show in Project Structure dialog
But installing this repository will create the problem of the support library not matching the compile version.
Am I doing something wrong?