Android-谷歌日历-网络错误

Android-谷歌日历-网络错误,android,google-calendar-api,Android,Google Calendar Api,为了理解google calendar API的工作原理,我按照给出的说明进行了操作 然而,我总是得到错误作为 E/Auth: [GoogleAccountDataServiceImpl] getToken() -> NETWORK_ERROR. Account: <ELLIDED:1752607581>, App: com.pravasah.experimetforworldcalendar, Service: oauth2: https://www.googleapis.c

为了理解google calendar API的工作原理,我按照给出的说明进行了操作

然而,我总是得到错误作为

E/Auth: [GoogleAccountDataServiceImpl] getToken() -> NETWORK_ERROR. Account: <ELLIDED:1752607581>, App: com.pravasah.experimetforworldcalendar, Service: oauth2: https://www.googleapis.com/auth/calendar
Caused by: android.system.ErrnoException: isConnected failed: ECONNREFUSED (Connection refused)
[GetToken] GetToken failed with status code: NetworkError
E/Auth:[GoogleAccountDataServiceImpl]getToken()->网络错误。帐户:,应用程序:com.pravasah.experimetforworldcalendar,服务:oauth2:https://www.googleapis.com/auth/calendar
原因:android.system.ErrnoException:isConnected失败:econnreflused(连接被拒绝)
[GetToken]GetToken失败,状态代码:NetworkError
找不到确切的问题。。所有其他需要网络的应用程序都工作正常。。只有此应用程序出现网络错误

好心帮忙

[编辑] 具体来说,错误是谷歌服务器拒绝连接。 我已经为应用程序启用了日历API,还生成了客户端ID,但我觉得这个错误是在检查任何权限之前出现的。 据我所知,对于调试应用程序,生成的SHA1总是相同的,所以我只为一个同名应用程序启用了oAuth2.0客户端


谷歌服务器什么时候拒绝连接?

您是否在清单中添加了Internet权限?是的。。。我已交叉检查您的设备是否正确连接到internet?是的,正如我所说,我的所有其他依赖internet的应用程序都工作正常。我在这篇文章中发现,EconRefused意味着客户端的连接请求到达了主机,但主机拒绝允许客户端连接,因为请求的端口上没有侦听内容。所以这涉及到一个IP问题。有关更多信息,请检查您收到的此邮件。