capacitor-firebase-analytics icon indicating copy to clipboard operation
capacitor-firebase-analytics copied to clipboard

Build failure after initial install: No such property: config for class: com.google.gms.googleservices.GoogleServicesPlugin

Open beckyhilton opened this issue 4 years ago • 7 comments

I'm getting a build failure after the initial setup of the plugin

FAILURE: Build failed with an exception.

  • Where: Build file '/builds/beckyhilton/ionic-vairkko/node_modules/capacitor-firebase-analytics/android/capacitor-firebase-analytics/build.gradle' line: 54

  • What went wrong: A problem occurred evaluating project ':capacitor-firebase-analytics'.

No such property: config for class: com.google.gms.googleservices.GoogleServicesPlugin

this is the line it doesn't like: com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

beckyhilton avatar Jun 03 '20 20:06 beckyhilton

+1

shailendramonu avatar Jun 08 '20 11:06 shailendramonu

+1

raymondmcevilly-za avatar Jun 11 '20 19:06 raymondmcevilly-za

I commented out the line: com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

And it seemed to work. Not 100% sure what it does yet - still looking around. However found the following reason as to why it might be breaking - taken from https://github.com/OneSignal/OneSignal-Gradle-Plugin/issues/37

Starting with com.google.gms:google-services:4.3.0 you must now instead add the following to the bottom of your app/build.gradle, after the apply.

googleServices { disableVersionCheck = true } This also works with previous version of com.google.gms:google-services.

raymondmcevilly-za avatar Jun 11 '20 19:06 raymondmcevilly-za

I tried some of those changes and then I think I ran into some other issues with duplicate code or something. I'm not sure I tried like 4 different ways to get some sort of firebase analytics working and I still haven't been successful yet

beckyhilton avatar Jun 11 '20 19:06 beckyhilton

After commenting out the 'disableVersionCheck', and building the app, I got the following errors: image

Looks similar to what you got? If so, here's what I had to do to get it working. In the capacitor-firebase-analytics build.gradle file, I upped the following dependencies, com.google.gms:google-services:4.3.3 com.google.firebase:firebase-core:17.4.3

That sorted the duplicate class issue, but introduced one more issue. I'm using Capacitor 2.0.0+, which uses Android X, however this plugin doesn't use it yet. So I did the following: npm install jetifier npx jetifier ionic cap sync

Built the app again, and it worked. See here for info on AndroidX Hope this helps.

raymondmcevilly-za avatar Jun 11 '20 22:06 raymondmcevilly-za

Sorrry, but where is the flag "com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true" to commenting out?

tanks

Paulovsr avatar Jun 22 '20 17:06 Paulovsr

@Paulovsr - sorry, only seeing this now - after you do your ionic cap sync, it should be in your capacitor-firebase-analytics build.gradle file (...\app\node_modules\capacitor-firebase-analytics\android\capacitor-firebase-analytics).

That being said, I watched some of the Ioniconf during the week, and it pointed me to the new list of 'community-supported' plugins. Since this plugin is not really being updated anymore, perhaps its a good idea to try this one out: https://github.com/capacitor-community/firebase-analytics.

I'll see if I can test it out sometime next week, and post back here if I experienced a smoother experience :)

raymondmcevilly-za avatar Jun 26 '20 21:06 raymondmcevilly-za