0

Adding this line to my gradle:

implementation 'com.google.firebase:firebase-analytics:17.0.1'

Results in this error:

error: resource android:attr/fontVariationSettings not found.

Based on what I read online, to fix this, I upgrade my compileSdkVersion from 27 to 28:

compileSdkVersion 28

Then I get this error when I try to run:

Program type already present: com.google.android.gms.internal.measurement.zzbq

And from there it's a spinning circle changing things and version numbers and adding things to the settings.gradle, etc, with androidx. I have no idea how to fix this, and I imagine there is a more simple solution. Thoughts?

EDIT: It may be worth mentioning that when I made the above changes, I see red across all of these, indicating that it should not use a different version (27) than the compileSdkVersion (28), so I'm not sure if I should make that change:

implementation "com.android.support:support-v4:$rootProject.supportVersion"
implementation "com.android.support:appcompat-v7:$rootProject.supportVersion"
implementation "com.android.support:recyclerview-v7:$rootProject.supportVersion"
implementation "com.android.support:cardview-v7:$rootProject.supportVersion"
implementation "com.android.support:design:$rootProject.supportVersion"
svguerin3
  • 2,433
  • 3
  • 29
  • 53

3 Answers3

0

Well try to change to the latest version of firebase-analytics

com.google.firebase:firebase-analytics:17.1.0

And in your build.gradle

classpath 'com.google.gms:google-services:3.2.1
Cyrille Con Morales
  • 918
  • 1
  • 6
  • 21
0

Paste below lines in build.gradle (Module:app) may this help you:

    configurations.all {
    resolutionStrategy {
            force 'com.android.support:support-v4:27.1.0'
      }
    } 

This will force the build to use a lower support library.

Geekfreak
  • 13
  • 10
0

Turned out I needed to go back to this version of Analytics for it to play nicely with my project:

implementation 'com.google.firebase:firebase-analytics:16.0.3'

The app compat libraries are not compatible with v17 or later of the analytics SDK, since it was migrated to androidx (androidx and the old v4 and v7 support libs are not compatible). So in order to use the latest one, we would have to migrate all code to use androidx (which was not an option at this time).

svguerin3
  • 2,433
  • 3
  • 29
  • 53