Android studio - 將 GCM api 更新為 Google 服務 (Android studio - updating GCM api to Google services)


問題描述

Android studio ‑ 將 GCM api 更新為 Google 服務 (Android studio ‑ updating GCM api to Google services)

我的應用程序使用 GCM 已經很長時間了。由於舊的 API 已被棄用,我正在嘗試升級它並使用 google‑services‑gcm。

我按照谷歌網站上的建議步驟進行操作,但出現以下錯誤:

任務':mylib:processReleaseGoogleServices'執行失敗。

模塊根文件夾中缺少文件 google‑services.json。沒有它,Google 服務插件將無法運行。

我已經將我的應用配置為使用 GCM,但以前我們不需要這樣的文件。我需要為我的應用生成一個新的嗎?


參考解法

方法 1:

Yes, that's now the right way to do it.

The gradle plugin will generate the XML files for you when building it and put it in the correct build/ folders.

(by lyc001zmarkan)

參考文件

  1. Android studio ‑ updating GCM api to Google services (CC BY‑SA 2.5/3.0/4.0)

#android-googleapiclient #android-studio #Android #google-cloud-messaging






相關問題

Scope 在 GoogleApiClient 中的作用是什麼? (What does Scope do in GoogleApiClient?)

Android studio - 將 GCM api 更新為 Google 服務 (Android studio - updating GCM api to Google services)

Android:為沒有 Google Play 服務的用戶登錄 Google? (Android: Google signin for a user without Google Play Services?)

GoogleApiClient onConnected 未被調用,在服務中使用 (GoogleApiClient onConnected not being called, using in a Service)

從 Play 商店安裝應用程序後嘗試使用 Google 登錄時出現“使用 Google 進行身份驗證時出錯:未知”異常。閱讀詳情 (Getting 'Error authenticating with Google: unknown' exception when trying to signin with google after installing app from play store. See details)

Android google Sign In 總是顯示 handleSignInResult:false (Android google Sign In always shows handleSignInResult:false)

Android Google Play 遊戲服務 (Android Google Play Games Services)

android - 即使沒有可用的互聯網,也會調用 onLocationChanged (android - onLocationChanged is called even when there is not internet available)







留言討論