Q:

Automatic Beta Releases with crashlytics

My android application has a Library which includes 'crashlytics.start()'. I have only set Crashlytics.jar as a dependency for the Library project. Builds are successful. 
I have multiple flavors configured in app> build.gradle file as well.
Given that one of my builds flavors are called "production", I have the following configuration in my app> build.gradle file
   buildscript {
    repositories {
        mavenCentral()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.13+'

    }
}

apply plugin: 'android'

repositories {
    mavenCentral()

}

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.1"

    defaultConfig {
        applicationId "com.test.testapp"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "0.0.6"
    }
    buildTypes {
        release {
            ext.enableCrashlytics=true
            runProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            ext.betaDistributionEmails="email" 
            ext.betaDistributionReleaseNotes='Testing automatic release.Ignore this version'

        }

        debug{
            ext.enableCrashlytics=true
            runProguard false

        }
    }

    productFlavors {
        production {
            applicationId "com.test.testapp"
        }

        staging {
            applicationId "com.test.testapp.staging"
        }

        preprod {
            applicationId "ccom.test.testapp.preprod"
        }

    }
}

dependencies {
    compile 'com.android.support:support-v4:18.+'
    compile 'com.android.support:appcompat-v7:21.0.2'
    compile project(':lib1')
    compile project(':lib2')

}

I use following command to upload the built 'production 'flavor to crashlytics
assembleproductionRelease crashlyticsUploadDistributionproductionRelease 
However I get the following error 
Task 'crashlyticsUploadDistributionproductionRelease' not found in root project 

This looks similar to this question however the solution is not working for me. There for posting with details.
NOTE: I have added a local crashlytics.jar when including crashlytics dependency. Since including the hosted crashlytics dependency had issues when compiling the project.

A:

I have working configuration in my environment, so will just share gradle.build pieces that are different:
1. Buildscript
buildscript {
    repositories {
        jcenter()
        maven { url 'http://download.crashlytics.com/maven' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
        classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
        classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'
    } 
}

Don't forget to apply plugin

apply plugin: 'crashlytics'

Repositories 

repositories {
        mavenCentral()
        maven { url 'http://download.crashlytics.com/maven' }
    }

Hope this will help

