Search code examples
androidreportingcrashlytics

Reproduced months ago with old apps and new: Crashlytics was not reporting crashes in old apps or registering my new apps


Update: This question is no longer required, as it is out of the scope of SOW. I have voted that it should be closed. Please note that some researches were done to find out the answer, that I have accepted. There were issues in Crashlytic that were fixed few weeks after this question was posted. I had a chat with a person from Crashlytics, and he replied that there were issues with the version I was using.

During the period of 3 months, when I reported this issue, I already had the latest crash that was reported in another app 30 days ago. I was making the force crashes again (in those previous apps, where it was working). Those force crashes were not reported in CrashLytics DashBoard, more than that the new apps were also not registered.

There is no problem in the following code, as after few weeks everything was fine again.

I was using Fabric plugin in my Android Studio, Gradle version 3.1.3.

More details:

Crashlytics Plugin:

buildscript {

    repositories {
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        // These docs use an open-ended version so that our plugin
        // can be updated quickly in response to Android tooling updates

        // We recommend changing it to the latest version from our changelog:
        // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'io.fabric.tools:gradle:1.25.4'

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

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
}

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

Dependency:

implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
    transitive = true;
}

and

implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:design:28.0.0-alpha1'
implementation 'com.android.support:support-v4:28.0.0-alpha1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'

App Version:

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.mypackage"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

In my application [derived and manifest registered] class's onCreate method:

final Fabric fabric = new Fabric.Builder(this)
                .kits(new Crashlytics())
                .debuggable(true)
                .build();
        Fabric.with(fabric);

If anyone had faced the issue, he or she could find great help from the answer of the post.


Solution

  • Steps which might recover you out from most strange build-related problems like this when you're using Android Studio :

    • Android Studio Build-System is directory based (.idea), so one thing you can do is to try the first test by removing all .idea .gradle *.iml and build caches from project.rootdir and project/app and then importing the project again into Studio
    • If the above doesn't help :-( : copy your java/manifest/build.gradle(s) to another location. Create a new project in Android Studio with the same configs before. When you're done,
    • Copy-paste manifest code (except the <meta-data android:name="io.fabric.ApiKey" android:value="....." /> )
    • Copy-paste dependencies and other required configs from Gradle configs
    • Copy Java codes now and must remove ALL Fabric related codes
    • Don't import fabric.properties into rootdir/app.
    • I'm assuming that the Fabric plugin is installed and have set up. Now, set up Fabric codes from it (I just want to leave everything on the Fabric team / but in your case, they've done a mess) and do a test crash, check if it worked
    • If it doesn't work though, it's impossible for me to tell you a way.

    more than that the new apps are also not registered

    Why not open another Fabric account using your secondary email and test it ?


    Maybe not logical, but can you please try Gradle version 3.1.2? I've also some bugs fixed when downgraded Gradle from 3.1.3 to 3.1.2 (build-related and strange problems)

    dependencies {
            classpath 'com.android.tools.build:gradle:3.1.2'
    }
    

    And, if you're only using Crashlytics then why this complex implementation? This single snippet also will make your work.

    Fabric.with(this, new Crashlytics());
    

    Just found where your issue was!

    Quickly do this :

    implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
            transitive = true
    }
    

    I tested with 2.6.8, wanted crash worked, but 2.9.4 doesn't respond! The bug exists at 2.9.4! 2.6.8 has all of the functions available for you. You can fill also a bug report though.