简体   繁体   English

适用于Android SDK的Gmail API 21

[英]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? 难道我做错了什么?

You can try to go to SDK manager and install three component: Google Repository, Android Support Library and Google Play Services. 您可以尝试使用SDK管理器并安装三个组件:Google Repository,Android支持库和Google Play服务。 like following picture: 如下图: 在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 降级Android SDK(api 23 - &gt; api 21) - Downgrade Android SDK( api 23 -> api 21) Android SDK 5.0 API 21Emulator 中的互联网问题 - Internet issue in Android SDK 5.0 API 21Emulator 在 Android Studio 上下载 API 21:SDK 管理器不起作用 - Download API 21 on Android Studio : SDK Manager doesn't work Android &lt;sdk 21提供InflateException - Android < sdk 21 giving InflateException Android SDK 21库错误 - Android sdk 21 library errors Android GridLayout API 21 - Android GridLayout API 21 Visual Studio 无法安装 Android SDK(API 级别 19 和 21)(缺少 extra-android-support) - Visual Studio can't install Android SDK (API level 19 and 21) (missing extra-android-support) 有什么方法可以使用 Android CameraX API 最小 SDK 小于 21? - Is there any way to use Android CameraX API with minimum SDK less than 21? setSupportProgressBarIndeterminateVisibility在与Android 5.0 SDK(API 21)一起使用时引发java.lang.NullPointerException - setSupportProgressBarIndeterminateVisibility raising java.lang.NullPointerException when used with Android 5.0 SDK (API 21) Android API级别21向后兼容? (自SDK新版本发布以来) - Android API level 21 backward compatibility? (Since the new update of the SDK came out)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM