play-services-plugins icon indicating copy to clipboard operation
play-services-plugins copied to clipboard

After updating to AGP 4.1.0, Google Services plugin can no longer find a matching client

Open sky-ricardocarrapico opened this issue 5 years ago • 6 comments

Describe the bug

After updating to AGP 4.1.0, Google Services plugin can no longer find a matching client.

Our setup is the following:

buildTypes { debug { applicationIdSuffix ".debug" ... } release { ... } }

JSON files app/google-services.json (this one contains the client for "xxx.xxx.debug")

app/src/release/google-services.json (this one contains the client for "xxx.xxx")

Tested with the last google services plugin version (4.3.4). It was working fine with AGP 4.0.1.

It can no longer find a matching client for "xxx.xxx" while we have the debug type selected. It seems to only be searching on "app/google-services.json".

Expected behavior To keep working after updating to 4.1.0

Desktop (please complete the following information):

  • Gradle version: 4.1.0
  • Android Studio version: 4.1
  • Plugin name and version: google-services-plugin 4.3.4

sky-ricardocarrapico avatar Oct 13 '20 11:10 sky-ricardocarrapico

same problem

KiYoEcol avatar Oct 14 '20 10:10 KiYoEcol

Are there any updates on this? It breaks our implementation too.

Vrachno avatar Oct 20 '20 08:10 Vrachno

I'm investigating this

In the meantime: A similar bug has occured in 4.3.3, for which the workaround was to apply the plugin at the bottom of your gradle file rather than the top, that may work here as well. Please let me know if it does as that would narrow down the causes of this issue.

davidmotson avatar Oct 22 '20 17:10 davidmotson

It's a duplicate of #163

You can use AGP 4.1.0 with google-services-plugin 4.3.3 (but not 4.3.4)

mmathieum avatar Nov 11 '20 17:11 mmathieum

@davidmotson moving apply to the bottom of the script does not work. In our script we had it there since 4.3.3, but after switching to 4.3.4 with AGP 4.1.X the issue appears

There is workaround in this SO thread: https://stackoverflow.com/questions/64170278/incorrect-google-services-json-is-picked-by-com-google-gmsgoogle-services4-3-4

Would not call it a fix just because it contradicts official docs

silin avatar Nov 16 '20 22:11 silin

v4.3.5 claims to fix this and it seems to work for me: https://firebase.google.com/support/release-notes/android#google-services_plugin_v4-3-5

https://github.com/google/play-services-plugins/issues/163#issuecomment-780154586

mmathieum avatar Feb 16 '21 22:02 mmathieum