error when apply plugin: 'com.google.gms.google-services'

后端 未结 8 1526
夕颜
夕颜 2021-02-19 02:44

I followed google documentation to integrate my app to Google Analytics. But when adding

apply plugin: \'com.google.gms.google-services\'

and b

相关标签:
8条回答
  • 2021-02-19 03:38

    As many ppl said, I've added "classpath 'com.google.gms:google-services:3.0.0'" in the project level gradle.

    But, I encountered another error saying "File google-services.json is missing from module root folder.". Eventually, I needed to set up a project via the following link. https://developers.google.com/mobile/add?platform=android

    After setting up a project and it took me to go to Firebase console. In that page, I was able to download google-service.json file which was essential to solve this issue.

    Drag and drop that JSON file under your project's '/app' folder.

    It took me an hour to figure it out. I hope it's helpful for someone.

    0 讨论(0)
  • 2021-02-19 03:38

    Change following code in project.properties from:

    cordova.system.library.2=com.google.android.gms:play-services-gcm:+
    cordova.system.library.3=com.google.android.gms:play-services-location:+
    

    to

    cordova.system.library.2=com.google.android.gms:play-services-gcm:11.0.1
    cordova.system.library.3=com.google.android.gms:play-services-location:11.0.1
    

    and add google-service.json file to app module

    0 讨论(0)
提交回复
热议问题