Issue
Apps sometimes crash during development and are known to crash during development. Unnecessarily sending emails to clients about stability issues of some tendencies in the app.
So I would like to know if there is a way to stop logging during the development process.
Solution
Crashlytics gives you the option to opt in or out from sending crash reports. You could use this in your code to prevent sending crash reports during development.
For this you could set the firebase_crashlytics_collection_enabled
property in the AndroidManifest.xml
file to false
.
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="false" />
With this option you can then re-enable Crashlytics data collection when running the release version:
if(!BuildConfig.DEBUG){
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
}
Or a similar option could be disabling Crashlytics data collection only when running the debug build. In this case, the the manifest property is not required.
if(BuildConfig.DEBUG){
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(false);
}
Answered By – Gerardo
Answer Checked By – Marilyn (Easybugfix Volunteer)