5

Everyone read before suggesting answer and update yourself (Do not give Fabric suggestion): https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android

My app has already been registered with firebase.

I setup everything, but not change anything in manifest and Application class.

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

android {
    /* compileSdkVersion 'android-R'*/
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.xxxxxxxxxxxx"
        minSdkVersion 21
        /* targetSdkVersion 'R'*/
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    lintOptions {
        checkReleaseBuilds true
        abortOnError false
    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        customDebugType {
            debuggable true
        }
    }

    dataBinding {
        enabled = true
    }
    useLibrary 'org.apache.http.legacy'
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.1.0'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    //Lifecycle components
    def life_versions = "2.2.0-beta01"

    implementation "android.arch.lifecycle:extensions:$life_versions"
    annotationProcessor "android.arch.lifecycle:compiler:$life_versions"

    //Server API Integration
    implementation 'com.squareup.retrofit2:retrofit:2.7.1'
    implementation 'com.squareup.retrofit2:converter-gson:2.7.1'
    implementation "com.squareup.okhttp3:logging-interceptor:4.4.0"
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.7.1'

    //For QR Scanner
    implementation 'com.google.android.gms:play-services-vision:19.0.0'

    //Show DB on Chrome
    implementation 'com.facebook.stetho:stetho:1.5.1'

    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
    implementation 'com.github.sundeepk:compact-calendar-view:1.7.8'
    implementation 'de.hdodenhof:circleimageview:3.1.0'
    implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    implementation 'com.google.firebase:firebase-analytics:17.2.3'
    implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta01'
}

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.0-beta03'
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta02'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

it's not working, I tried to crash my app and checked on firebase console as well

Update:

In firebase console,

To see this data, make sure your app has Google Analytics for Firebase and the latest Fabric SDK or Firebase Crashlytics SDK.

but I already added

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Could you please post the full build.gradle file? – Max Mar 21 '20 at 10:36
  • Does this answer your question? [Firebase Crashlytics not reporting crashes when manually enabled](https://stackoverflow.com/questions/53724973/firebase-crashlytics-not-reporting-crashes-when-manually-enabled) – Hooman.AS Mar 21 '20 at 10:56
  • @Hooman.AS noopeee –  Mar 21 '20 at 10:57
  • @Max check, make sure fabric is almost shutdown –  Mar 21 '20 at 10:58
  • @Max https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android –  Mar 21 '20 at 11:21
  • @Hooman.AS https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android –  Mar 21 '20 at 11:21
  • Did you get any solution? I am suffering the same issue – Dewsworld Jun 14 '20 at 16:10
  • @Dewsworld Nope sweetie –  Jun 15 '20 at 19:15
  • I had a same issue. My issue was fixed after following exact steps in the link below. https://firebase.google.com/docs/crashlytics/get-started?authuser=0&platform=android After you follow the steps in the link please check the SHA certificate fingerprints in firebase project settings, clean the android studio project, invalidate caches and restart, re run the project and crash the app runtime to test the implementation. Let me know if this comment helped. – Arvin Jayanake Nov 02 '20 at 12:41

8 Answers8

2

Check your manifest. In the application tag, check for this property,

tool:node="replace" 

Remove this property.

Dewsworld
  • 13,367
  • 23
  • 68
  • 104
  • 1
    I have spend 4 hours and finally working fine after remove tool:node="replace" Any one can explain me why we need to remove this? – Sagar Vasoya Jun 17 '20 at 10:55
1

Add

repositories {
    google()
    mavenCentral()
}

to Repositories

Paul Roub
  • 36,322
  • 27
  • 84
  • 93
BarisBr
  • 128
  • 10
1

I updated the dependencies today and apparently they fixed the issue.


build.gradle (project level)

classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'

build.gradle (app level)

implementation 'com.google.firebase:firebase-crashlytics:17.1.0'
luchin
  • 52
  • 5
0

try this I hope it will work with you .

dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        // Check for v3.1.2 or higher
        classpath 'com.google.gms:google-services:4.3.2'  // Google Services plugin

        // Add dependency
        classpath 'io.fabric.tools:gradle:1.31.2'  // Crashlytics plugin

    }
0

First, make sure your dependencies are up to date for Crashlytics:

// Add the Firebase Crashlytics SDK.
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta03'
// Add the Firebase Crashlytics Gradle plugin.
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta03'

It looks like you're running beta01 and beta02 simultaneously, which might cause problems.

Otherwise, try enabling debug mode for Crashlytics, building and running your app, crashing it, relaunching it, and then checking the logs on relaunch to ensure that Firebase and Crashlytics are starting up correctly, and that crashes are being sent to our servers.

Finally, check any other gradle setup you have for any old Fabric dependencies or configuration that might be causing the new Firebase SDK not to work.

Kevin Kokomani
  • 1,568
  • 7
  • 14
0

Please refer to the firebase documentation for latest updates on the crashlytics sdk by google. According to your configuration you need following changes:

1.Crashlytics version update in app level gradle

implementation 'com.google.firebase:firebase-crashlytics:17.2.2'

2.Crashlytics version update in project level gradle

classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'

3.New app level dependency

implementation platform('com.google.firebase:firebase-bom:25.12.0')

4.Analytics version update in app level gradle

implementation 'com.google.firebase:firebase-analytics:17.6.0'
0

I had a similar problem even though you haven't added the fabric, apparently you have to remove it within the manifest

    <meta-data
    tools:node="remove"
    android:name="io.fabric.ApiKey"/>

this should solve your problem, remember you need to uninstall app before running it again

khoshrang
  • 146
  • 11
-2

Use this:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
// Add the Fabric plugin.
apply plugin: 'io.fabric'

dependencies {
    // ...

    // (Recommended) Add the Google Analytics dependency.
    implementation 'com.google.firebase:firebase-analytics:17.2.3'

    // Add the Firebase Crashlytics dependency.
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
}

Also add this in your buildscript repositories:

maven { url 'https://maven.fabric.io/public' }
Mike
  • 1,313
  • 12
  • 21
  • 2
    fabric is shutdown –  Mar 21 '20 at 10:50
  • Not yet, they moved it until May 2020, here is some docs to save you the trouble: https://firebase.google.com/docs/crashlytics/get-started?platform=android – Mike Mar 21 '20 at 10:51
  • classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta02' –  Mar 21 '20 at 10:52
  • In your case this should be your classpath: // Add the Google Services plugin (check for v3.1.2 or higher). classpath 'com.google.gms:google-services:4.3.3' // Add the Fabric Crashlytics plugin. classpath 'io.fabric.tools:gradle:1.31.2' – Mike Mar 21 '20 at 10:53
  • A problem occurred configuring root project 'lifetrenz-gcc-doctorapp'. > Could not resolve all artifacts for configuration ':classpath'. –  Mar 21 '20 at 10:55
  • remove : in your class path. I have already left out the firebase crashlytics link: https://firebase.google.com/docs/crashlytics/get-started?platform=android please follow that instead, as it is more comprehensive. – Mike Mar 21 '20 at 11:04
  • but why fabric? –  Mar 21 '20 at 11:11
  • https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android –  Mar 21 '20 at 11:21