In my application, I want to use firebase Crashlytics and for this, I added below codes into my application.
I added this codes step by step from google document!
I added below codes but when sync application show me an error and not sync project.
Build.gradle (project) :
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.1.0'
classpath 'io.fabric.tools:gradle:1.26.1'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://dl.bintray.com/tapsellorg/maven' }
maven { url 'https://maven.google.com/' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build.gradle (app) :
dependencies {
implementation 'com.google.android.gms:play-services-base:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.7'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
but when added this line apply plugin: 'com.google.gms.google-services'
, when click on sync show me below error :
The library com.google.android.gms:play-services-base is being requested by various other libraries at [[11.0.2,11.0.2]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
How can I fix it?
Firebase Crashlytics is a lightweight, realtime crash reporter that helps you track, prioritize, and fix stability issues that erode your app quality. Crashlytics saves you troubleshooting time by intelligently grouping crashes and highlighting the circumstances that lead up to them.
build.gradle Module
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
// add the Firebase SDK for Google Analytics
// The app need this to init in Firebase console
implementation 'com.google.firebase:firebase-analytics:17.2.1'
// Add the Firebase SDK for Crashlytics.
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta01'
build.gradle Project
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta01'
You do not need fabric.io anymore, it is deprecated and will be available until March 31, 2020. Take a look at this Project and Video
if after all Firebase doesn't recognize the app, record an exception using this recordException
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With