Search code examples
androidgradlecrashlyticsgoogle-fabric

Disable mapping file (deob) upload on proguard build for Android Fabric/Crashlytics


Android App using proguard:

Crashlytics automatically uploads the mapping files for reach of your build variants. https://docs.fabric.io/android/crashlytics/dex-and-proguard.html#gradle

We need to get rid off this warning since our bamboo build agent has no outside connection.

WARN - Crashlytics had a problem uploading the deobs file. 
Please check network connectivity and try again.
build   22-Jan-2018 15:20:18    
com.crashlytics.reloc.org.apache.http.conn.HttpHostConnectException: Connect to cm.crashlytics.com:443

How can we disable this upload feature?

Edit - clarification: We do not want to disable crashlytics for this build; in fact we need it.. We just want to disable the upload of the mapping file since we have no outside connection on this agent.

Thanks in advance.


Solution

  • You can disable tasks by setting the enabled-flag in your top-level build.gradle file for specific tasks to false.

    subprojects {
        tasks.whenTaskAdded { task ->
            boolean isCrashlyticsTask = task.name.toLowerCase().contains("crashlytics")
            if (isCrashlyticsTask) {
                task.enabled = false
            }
        }
    }