問題描述
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.