Reputation:
I'm trying to update my google and firebase SDK libraries in my project to solve the problem of install_referrer deprecation but I got errors after sync
ERROR: Failed to resolve: com.google.firebase:firebase-crash:17.2.2
and this error on the merged manifest
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 <application> element at AndroidManifest.xml:28:5-422:19 to override.
here is my firebase and google dependency
implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'com.google.firebase:firebase-crash:17.2.2'
implementation 'com.google.firebase:firebase-config:19.1.1'
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-base:17.1.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.8'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.firebase:firebase-core:17.2.2'
implementation 'com.google.firebase:firebase-ads:18.3.0'
implementation 'com.google.firebase:firebase-messaging:20.1.0'
Upvotes: 9
Views: 16006
Reputation: 1549
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:29.0.0')
// Declare the dependencies for the Crashlytics and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics'
Upvotes: 0
Reputation: 80904
Use the following dependency:
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta01'
And Update your application to use AndroidX:
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.
https://developer.android.com/jetpack/androidx/migrate
You can now use the following dependency version:
dependencies {
// Recommended: Add the Firebase SDK for Google Analytics.
implementation 'com.google.firebase:firebase-analytics:17.5.0'
// Add the Firebase Crashlytics SDK.
implementation 'com.google.firebase:firebase-crashlytics:17.2.2'
}
If you are having trouble adding firebase-crashlytics
, then check the following documentation:
https://firebase.google.com/docs/crashlytics/get-started?platform=android
https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android
Upvotes: 19
Reputation: 81
Try to change com.crashlytics.sdk.android:crashlytics:17.2.2
to com.google.firebase:firebase-crashlytics:17.2.1
.
This worked for me.
Upvotes: 8
Reputation: 13129
Steps to add the new Firebase Crashlytics before november deprecation
from your build.gradle project module
// Remove Fabric's Maven repository from allProjects.
maven { url 'https://maven.fabric.io/public' }
// Remove the Fabric Gradle plugin.
classpath 'io.fabric.tools:gradle:1.31.2'
// Add the Firebase Crashlytics Gradle plugin.
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.1'
From your build.gradle app module
// Remove the Fabric plugin.
apply plugin: 'io.fabric'
// Add the Firebase Crashlytics plugin.
apply plugin: 'com.google.firebase.crashlytics'
dependencies {
// Remove the Fabric Crashlytics SDK.
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
// Add the Firebase Crashlytics SDK.
implementation 'com.google.firebase:firebase-crashlytics:17.2.1'
}
The links commented with // Remove
should not be in your gradle configuration, instead add the suggested dependencies and plugins
Source: https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android
As a quote from Peters answer, you should also have
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.
Upvotes: 4
Reputation: 218
Follow below document to intergrade crashlytics into your project
https://firebase.google.com/docs/crashlytics/get-started?platform=android&authuser=0#add-sdk
Project requirements
https://developer.android.com/jetpack/androidx/migrate
Upvotes: 1