How to disable Crashlytics during development

后端 未结 28 2599
心在旅途
心在旅途 2020-11-29 15:42

Is there any simple way to turn Crashlytics Android SDK off while developing ?

I don\'t want it to send a crash every time I do something stupid

On the othe

28条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 16:00

    Check out the latest doc. https://docs.fabric.io/android/crashlytics/build-tools.html#gradle-advanced-setup.

    Apart from adding ext.enableCrashlytics = false in build.grade you need to do,

    Crashlytics crashlyticsKit = new Crashlytics.Builder()
        .core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
        .build();
    
    // Initialize Fabric with the debug-disabled crashlytics.
    Fabric.with(this, crashlyticsKit);
    

提交回复
热议问题