Disable importing of Crashlytics

假如想象 提交于 2019-11-29 14:26:07

问题


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

On their page (and in various stackoverflow threads) its 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 everytime 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 wouldnt even be compiled into the app with enableCrashlytics = false (strange "problem" to report, I know).

I want to understand why the app doesnt crash (to further improve my understanding of using the build.gradle file). And I want to understand why I cant disable Crashlytics with the gradle directive proposed by Crashlytics themselve. 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?


回答1:


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.



来源:https://stackoverflow.com/questions/28339323/disable-importing-of-crashlytics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!