Reputation: 1748
Recently we attempted to migrate from Fabric.io to FirebaseCrashlytics. Followed steps as described in documentation https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android
setCrashlyticsCollectionEnabled(!BuildConfig.DEBUG)
After that, we try to run our test suite when we noticed that it is taking much longer than usual and in the end it failed with many tests reporting OutOfMemoryError. This set of tests run just fine with Fabric dependencies. Does anybody had or run into a similar problem?
Upvotes: 3
Views: 1042
Reputation: 1748
OK, I do have update on this. We just updated libraries to latest version that was recently published and issue looks to be sorted
com.google.firebase:firebase-crashlytics-gradle:2.2.0
instead of 2.1.0com.google.firebase:firebase-crashlytics:17.1.0
instead of 17.0.0which original article was published with
Upvotes: 0
Reputation: 311
Documentation says Fabric Crashlytics SDK uses a ContentProvider to initialize itself. So it is too late call setCrashlyticsCollectionEnabled function in your Application Code.
Fabric's API key is no longer used by the new SDK. Instead, Crashlytics now uses your app’s google-services.json file to associate your app with your Firebase project and retain your historic crash data. If you have an io.fabric.ApiKey declared in your AndroidManifest.xml file, remove it.
If you want to disable automatic crash reporting and enable it only for select users, use the Android meta-data tag in your AndroidManifest.xml file. Then, you can enable crash reporting using the new setCrashlyticsCollectionEnabled instance method.
So you need to disable data collection in your manifest. In order to do that you need to add firebase_crashlytics_collection_enabled meta-tag to your manifest.
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="false" />
You might want to inject build variables to manifest file since you only want to disable Crashlytics in your test builds. See the link down below. https://developer.android.com/studio/build/manifest-build-variables.html
Upvotes: 2