GoogleApiClient.addApi() doesn't support Gmail API

霸气de小男生 提交于 2020-01-04 04:37:29

问题


I'm trying to use the following code to get an authentication with the given APIs but the addApi is neither recognizing Gmail as an API or Gmail.API as an API. Because of this I'm getting an Unauthorized 401 going further into the application when trying to retrieve the messages.

mGoogleApiClient = new GoogleApiClient.Builder(this)
                .addConnectionCallbacks(this)
                .addOnConnectionFailedListener(this)
                .addApi(Plus.API)
                .addScope(Plus.SCOPE_PLUS_LOGIN)
                .addApi(Gmail)
                .addScope(GmailScopes.GMAIL_READONLY)
                .build();

来源:https://stackoverflow.com/questions/29636724/googleapiclient-addapi-doesnt-support-gmail-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!