[英]Gmail API for Android SDK 21
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的Gmail API开发适用于API 21的设备。在本教程中: https : //developers.google.com/gmail/api/quickstart/android它说我需要:
Android SDK packages for API 23 or later, including the latest versions of Google Repository, Android Support Library and Google Play Services. 适用于API 23或更高版本的Android SDK包,包括最新版本的Google Repository,Android支持库和Google Play服务。
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. 但是当我使用它时我得到一个错误,说我无法使用:com.android.support:appcompat-v7:23.4.0当我的编译SDK版本是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: 我已经尝试将appcompact版本更改为v7:21.0.2之前对我有用,但是当我同步gradle文件时,我收到错误:
Error: Failed to resolve: com.android.support:appcompat-v7:23.1.1 错误:无法解决:com.android.support:appcompat-v7:23.1.1
Install Repository and sync project 安装存储库和同步项目
Open File 打开文件
Show in Project Structure dialog 在Project Structure对话框中显示
But installing this repository will create the problem of the support library not matching the compile version. 但是安装此存储库会产生支持库与编译版本不匹配的问题。
Am I doing something wrong? 难道我做错了什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.