How to disable Firebase Crash Reporting when the app is running on debug?

后端 未结 16 1305
谎友^
谎友^ 2020-12-04 13:42

I have successfully implemented Firebase Crash Reporting, but I need to disable the service when the app is running undo the \'debug\' Build Variant, in order to avoid non-r

16条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-04 14:34

    The simplest solution for users when they run app in Debug mode or in Release mode:

    AndroidManifest.xml:

    
    

    build.gradle(Module:app)

    buildTypes {
    
            debug {
                manifestPlaceholders = [analytics_deactivated: "false"]
            }
    
            release {
                manifestPlaceholders = [analytics_deactivated: "true"]
    
            }
        }
    

    Hence, when the app is in release mode, the crashlatics will be turned on and app runs in debug mode, it would be turned off.

提交回复
热议问题