Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable importing of Crashlytics

I just recently integrated Crashlytics into my App. But I am having a "problem": It's always enabled.

On their page (and in various stackoverflow threads) it's said to turn it off I have to include ext.enableCrashlytics = false into my build.gradle. So my buildTypes look like the following:

buildTypes {
        debug {
            applicationIdSuffix ".debug"
            versionNameSuffix "-DEV"
            ext.enableCrashlytics = false
        }
        release {
            minifyEnabled false //TODO:Switch to true and add Proguard config to release
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            ext.enableCrashlytics = true
        }
    }

But every time I run the debug buildType the application works without any crashes, i.e. Crashlytics.start(this) works without a crash even though I thought that it wouldn't even be compiled into the app with enableCrashlytics = false (strange "problem" to report, I know).

I want to understand why the app doesn't crash (to further improve my understanding of using the build.gradle file). And I want to understand why I can't disable Crashlytics with the gradle directive proposed by Crashlytics themselves. I know I can get rid of Crashlytics by simply not starting it (no call to Crashlytics.start(this)) but then the directive enableCrashlytics would be useless, right?

Am I missing something?

like image 269
degill Avatar asked Feb 05 '15 08:02

degill


1 Answers

Mike from Crashlytics here.

ext.enableCrashlytics = false

disables sending a mapping file to our backend or generating an ID for your build, which speeds up gradle builds of those flavors.

If you want to disable Crashlytics for debug builds, then the answers from this SO question should help.

like image 73
Mike Bonnell Avatar answered Oct 18 '22 23:10

Mike Bonnell