Execution failed for task ':app:processReleaseGoogleServices'. > No matching client found for package name

后端 未结 5 1486
旧时难觅i
旧时难觅i 2021-01-12 04:09

Anytime I try to build my project I keep getting this error:

Execution failed for task \':app:processReleaseGoogleServices\'.
No matching client found for pa         


        
相关标签:
5条回答
  • 2021-01-12 04:18

    You need to provide google-services.json for all flavors (release and development etc)

    Single google-services.json can have json/data for all flavors. Go to Google Developers Console and regenerate google-services.json file

    Update

    You can also create separate google-services.json files for flavors

    https://developers.google.com/android/guides/google-services-plugin

    0 讨论(0)
  • 2021-01-12 04:20

    Probably a bit late but I had a similar problem.

    It occurred when I initially connected my app to Firebase analytics for some reason it only picked up my "debug" flavor.

    I had to log into Firebase, go to the console and select the relevant project and then manually add the additional "release" flavor.

    Then I reconnected to Firebase in Android Studio (which automatically updated and downloaded the json file from Firebase into Studio), re-compiled my app and it worked.

    0 讨论(0)
  • 2021-01-12 04:30

    The problem was actually with NewRelic not with my configuration. I removed it and followed this answer as I was using BuildTypes. Now it compiles as expected.

    0 讨论(0)
  • 2021-01-12 04:31

    In my case it solved my problem

          ...  
     "client": [
            {
              "client_info": {
                "mobilesdk_app_id": "yourid",
                "android_client_info": {
                  "package_name": "ru.example.app"
                }
              },
           ...
    

    package_name should be same as in applicationId

            defaultConfig {
                    applicationId "ru.example.app"
                    minSdkVersion 15
                    targetSdkVersion 23
                    ...
        }
    
    0 讨论(0)
  • 2021-01-12 04:37

    Google just included support for flavors on version 2.0 of the play services plugin. Since this version of the gradle plugin com.google.gms:google-services:2.0.0-alpha9

    you can do this

    For More details please go through below link. If you want more details about what this plugin does with these json files, here it is:

    Link to the official docs:

    And go here to check the latest version of this plugin:

    Ref link.

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