Reputation: 75
I have a working Android project that i am trying to add Firebase analytics. As soon as i add implementation 'com.google.firebase:firebase-analytics:17.2.1'
to my graddle it gives me the error at the end of the post. I tried several suggestins i found on other post like adding "-alpha1" at the end of appcompat line but it was a rabit hole. I also did what the error suggests but the same another rabbit hole.
Does any one have any other suggestions?
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.track.live"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.intuit.sdp:sdp-android:1.0.4'
implementation 'com.intuit.ssp:ssp-android:1.0.4'
implementation 'io.realm:realm-android:0.82.1'
implementation 'me.jahirfiquitiva:FABsMenu:1.1.4'
implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
testImplementation 'junit:junit:4.12'
annotationProcessor 'io.realm:realm-android:0.82.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
}
apply plugin: 'com.google.gms.google-services'
ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:14:5-52:19 to override.
Upvotes: 1
Views: 1353
Reputation: 80924
You are using the latest version of firebase analytics. Firebase migrated to androidx in June 2019, from the docs:
This release is a MAJOR version update and includes breaking changes.
With this release, libraries are migrated from the Android Support Libraries to the Jetpack (AndroidX) Libraries.
The updated libraries will not work unless you make the following changes in your app:
Upgrade com.android.tools.build:gradle to v3.2.1 or later.
Upgrade compileSdkVersion to 28 or later.
Update your app to use Jetpack (AndroidX); follow the instructions in Migrating to AndroidX.
The above is applied from version 17.0.0 of firebase analytics.
You can find more info here :
https://firebase.google.com/support/release-notes/android#2019-06-17
https://developer.android.com/jetpack/androidx/migrate
Upvotes: 1
Reputation: 303
You have a suggestion inside an error message "Suggestion: add 'tools:replace="android:appComponentFactory"" But my opinion and advice - move to androidX
Upvotes: 0