philmerrell / capacitor-firebase-analytics

Capacitor plugin that integrates Firebase Analytics for Android and iOS
17 stars 22 forks source link

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

Open beckyhilton opened 4 years ago

beckyhilton commented 4 years ago

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

FAILURE: Build failed with an exception.

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

shailendramonu commented 4 years ago

+1

raymondmcevilly-za commented 4 years ago

+1

raymondmcevilly-za commented 4 years ago

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.

beckyhilton commented 4 years ago

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

raymondmcevilly-za commented 4 years ago

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.

Paulovsr commented 4 years ago

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

tanks

raymondmcevilly-za commented 4 years ago

@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 :)