I have an app that utilises Fabric's Crashlytics via Firebase. The following is the first thing executed in my Applications onCreate
CrashlyticsCore crashlyticsCore = new CrashlyticsCore.Builder() .disabled(BuildConfig.DEBUG) .build(); Fabric.with(this, new Crashlytics.Builder().core(crashlyticsCore).build());
Nonetheless, the crashes are submitted in DEBUG == true
mode.
I use the following versions
in my build.gradle classpath "io.fabric.tools:gradle:1.25.1"
in my app/build.gradle implementation "com.crashlytics.sdk.android:crashlytics:2.9.1"
Unfortunately the crashes still get reported. Any ideas, what I am doing wrong?
To opt out of automatic crash reporting, pass false as the override value. When set to false, the new value does not apply until the next run of the app. To disable the crash logs while in debug mode you must pass ! BuildConfig.
Enable debug logging for CrashlyticsSelect Run from the left menu, then select the Arguments tab. In the Arguments Passed on Launch section, add -FIRDebugEnabled .
Implementation path. Start by adding Firebase to your app in the Firebase console. Add the Crashlytics SDK via CocoaPods, Gradle, or Pub, and Crashlytics starts collecting reports. Visit the Firebase console to track, prioritize, and fix issues in your app.
Correct answers have been posted by Bob Snyder and niqueco already however it seems kinda tedious to change the meta-data value every time you are building an actual release APK thus here's a solution that uses so called manifestPlaceholder and changes the value automatically to true
or false
depending on the buildType
.
Add the following to your apps build.gradle
android { // ... buildTypes { debug { manifestPlaceholders = [enableCrashReporting:"false"] } release { manifestPlaceholders = [enableCrashReporting:"true"] } } }
And this to your AndroidManifest.xml
<manifest ... > <application ...> // ... <meta-data android:name="firebase_crashlytics_collection_enabled" android:value="${enableCrashReporting}" /> </application> </manifest>
You can verify the current value by clicking on the Merged Manifest
tab once you have opened the AndroidManifest.xml. You should see something like this:
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