Fabric Debug Craslytic Reports : Signup, build Id missing, apply plugin : io.fabric
Asked Answered
S

13

28

We have programming an Android app and try to implement Crashlytics to our app.

We have different types of problem . Version we used : Android studio version : 3.3

Gradle version : classpath 'com.android.tools.build:gradle:3.3.1'

Plugin : Fabric for Android studio v4.3.0

Implementation : implementation('com.crashlytics.sdk.android:crashlytics:2.9.9') { transitive = true } implementation('io.fabric.sdk.android:fabric:1.4.0@aar') { transitive = true }

gradle-wrapper.properties : distributionUrl=https://services.gradle.org/distributions/gradle-5.2.1-all.zip

First Problem :

When we implement Crashlytics, you know that developers have 3 steps. We can not skip 2,3.steps. Because we have not compiled our application yet. We had two main errors:

Error 1:

This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,

Error 2 :

E/CrashlyticsCore: The Crashlytics build ID is missing.This occurs when 
Crashlytics tooling is absent from your app's build configuration.
Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.

So, we had to be disabled "Debug Mod" to complete implementation of Crashlytic.

Crashlytics crashlyticsKit = new Crashlytics.Builder()
        .core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
        .build();

Fabric.with(this, crashlyticsKit);  // Tod from Fabric suggested in stackoverflow

And implementation was completed.

But we do not want to do that. Because, when we have a crash, it does not any report to Crashlytics or Firebase. We also want to have debug mod’s crashes.

When we removed -> ....disabled(BuildConfig.DEBUG) - it shows again : Error 1, Error 2.

Second Problem :

In gradle ; apply plugin : ‘io.fabric’, we made the comment line, when we remove comments line, we have errors below :

Error 3 :

WARNING: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getExternalNativeBuildTasks(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
Affected Modules: app

When we searched it, this error related to new android studio gradle. So we needed to make comment line “apply plugin: fabric.io” again.

There is no good solution about that.

To run application we can not remove:

new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build() : (due to Error1 Error2)

So we try to enable report different ways :

What have we try to add until here?

1. Enable in gradle :

buildTypes {
    debug {
        manifestPlaceholders = [crashlyticsEnabled: true]
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        manifestPlaceholders = [crashlyticsEnabled: false]

    }

2. Enable in Manifest

<meta-data
    android:name="firebase_crashlytics_collection_enabled"
    android:value="true" />

3.Enable in ADB

  adb shell setprop log.tag.Fabric DEBUG
  adb shell setprop log.tag.CrashlyticsCore DEBUG

But still, Crashlytics or Firebase does not get any Debug Crash reports.

We have expecting your solutions.

Stirps answered 15/2, 2019 at 10:2 Comment(4)
I'm facing a similar issue. Does your app have several flavors?Loudhailer
we solved with adding android.debug.obsoleteApi=true to gradle.properties. fabric needs to develop for new gradle. They have bugs. This will allow all old methods and variables. When fabric updated it, do not forget to remove it.Stirps
I managed to fix it without adding what you suggested. I'll explain in a few as an answer.Loudhailer
Why are you specifying Proguard for debug builds?Vermicular
L
19

I managed to get this fixed without adding android.debug.obsoleteApi=true in gradle.properties.

I basically connected 3 flavors to different Firebase projects using proper flavor configuration and the provided google-services.json file.

What your gradle file is missing comparing it to mine is this:

dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath "com.google.gms:google-services:$google_services_version" // google-services plugin

    classpath "io.fabric.tools:gradle:$fabric_tools_version"

}


apply plugin: "io.fabric"

And finally: implementation "com.google.firebase:firebase-crash:16.2.1"

I know Fabric is going to shut down this year, but by running the apps this way, they connected to the Firebase console with no problem whatsoever.

Regarding the flavor configuration, I downloaded three different json files (I have 3 flavors) and added them in the root directory of each flavor. For example:

flavor1:
assets
java
res
AndroidManifest
google-services.json (for flavor1)

flavor2:
assets
java
res
AndroidManifest
google-services.json (for flavor2)

And that's it. Hope this helps someone.

EDIT
So, as you guys may already know, Fabric is shutting down and Firebase Crashlytics is ready, making this answer deprecated.
Please check here so you can successfully update your app and avoid weird behaviors.

Loudhailer answered 18/2, 2019 at 18:13 Comment(1)
Actually I think fabric solved this error. we remove obsolete=true from our code. Also for different flavors you do not need add separeted google-services.json. You can merge all of them in one google-service.json fileStirps
M
19

This also happens if you set ext.enableCrashlytics = false for a build variant but still try to call Fabric.with(context, Crashlytics()) in your app initialization code. ext.enableCrashlytics = false disables the build plugin (an optimization I made to make my debug builds faster) but then of course the build ID will be missing.

Marplot answered 23/6, 2019 at 5:21 Comment(0)
Z
18

Today I migrated from Fabric Crashlytics to Firebase Crashlytics and encountered a fatal error that didn't keep me going. What I did was this: In app-> build.gradle:

apply plugin: 'io.fabric'
dependencies {
 implementation "com.google.firebase:firebase-core:17.2.0"
// Add dependency
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
}

In general build.gradle:

buildscript {

repositories {

    maven {
        url 'https://maven.fabric.io/public'
    }
}
dependencies {
    classpath 'io.fabric.tools:gradle:1.31.2'  // Crashlytics plugin
}

And of course download the json file from Firebase and insert it in the app folder.

After completing these simple steps, I received this error when I started the application

The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.

I went to check that there wasn't any code that could call up old Fabric methods, and in fact I discovered that in app-> build.gradle I had this:

buildTypes {

    debug {
        minifyEnabled false
        debuggable true
        **ext.enableCrashlytics = false**
        ext.alwaysUpdateBuildId = false
    }    
}

ext.enableCrashlytics = false certainly it was a method that referred to the old Fabric, so I removed this line and everything worked perfectly! I hope to help someone with this

Zeus answered 21/10, 2019 at 12:42 Comment(3)
Thank you! Works.Idocrase
This line ext.enableCrashlytics = false is needed to speed up local debug builds....Impregnable
Yes, probably, but in this case it belonged to an old fabric, after the migration it gave problems. Likely they no longer have that method.Zeus
H
11

just set apply plugin: 'io.fabric' in ur build.gradle (app)

Hospitality answered 15/8, 2019 at 15:44 Comment(0)
F
11

In my case I was missing Crashlytics plugin:

apply plugin: 'com.google.firebase.crashlytics'

Put that line at the top of your module's build.gradle file e.g.

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics'
Flooring answered 29/5, 2020 at 16:46 Comment(0)
G
3

I faced the same issue when migrating from Fabric Crashlytics to Firebase Crashlytics, following steps fixed the issue for me

  • Clean your project
  • Update google-services.json file
Granado answered 7/7, 2020 at 9:0 Comment(0)
H
3

Just add this line in your build.gradle (Project):

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

and this plugin in your build Gradle (app):

apply plugin: 'com.google.firebase.crashlytics'
Hospitality answered 20/10, 2020 at 18:13 Comment(0)
T
2

I had the same problem in my app (Android Studio 3.4.1)

I fixed trough conecting to the Fabric Plugin. Creating an account and linking my app to it.

Turrell answered 29/5, 2019 at 16:33 Comment(0)
A
2

In my case i just update implementation 'com.google.firebase:firebase-core:16.0.9' to implementation 'com.google.firebase:firebase-core:17.0.1' and added apply plugin: 'io.fabric' to my app level gradle. This solved Error 2 for me.

Assemblage answered 23/7, 2019 at 12:43 Comment(0)
A
1

if you migrate from Fabric to Firebase please ensure you've called:

FirebaseApp.initializeApp(this)

in your Application onCreate().

No need any relation to Fabric anymore, just follow this guidance:

https://firebase.google.com/docs/crashlytics/get-started?platform=android

Aloke answered 16/7, 2020 at 8:4 Comment(1)
Explicit initialization of Crashlytics is no longer requiredSporades
A
0

In My case, I hade two modules that used a different version of FireBase Crashlytics.

Anaphora answered 23/6, 2020 at 10:18 Comment(0)
M
0

In My case, I miss this line: apply plugin: 'com.google.gms.google-services' Apply the Firebase Crashlytics Plugin to your app

For reference, https://rnfirebase.io/crashlytics/android-setup

Malaguena answered 23/9, 2020 at 3:26 Comment(0)
A
0

I had the same problem here and I fixed it by adding Fabric to Gradle

Here's my project Gradle file:

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

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'io.fabric.tools:gradle:1.+'
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    } 

Acetate answered 17/11, 2020 at 16:8 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.