Build.gradle not accepting version code as string
<p>Version code updates for 1 to 9 as <strong>string</strong> but, when update to 10 gives compile time error :</p>

<pre><code>Cannot cast object '10' with class 'java.lang.String' to class 'java.lang.Integer'

    versionCode = "10"
</code></pre>

<p>If i make version code as integer 10, i am able to generate signed apk but not able to upload in play store.</p>

<p>project was initially made in eclipse later migrated to android studio</p>

<pre><code>buildscript {
repositories {
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
}
}
</code></pre>

<p>android {
    compileSdkVersion 23
    buildToolsVersion '23.0.2'
    useLibrary 'org.apache.http.legacy'</p>

<pre><code>defaultConfig {
    minSdkVersion 16
    targetSdkVersion 23
    versionCode = 10
    versionName = "1.1.12"
    multiDexEnabled true
}

lintOptions {
    // set to true to turn off analysis progress reporting by lint
    quiet true
    // if true, stop the gradle build if errors are found
    abortOnError false
    // if true, only report errors
    ignoreWarnings true
}
buildTypes {
    release {
        minifyEnabled false
        zipAlignEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}




sourceSets.main {
    jniLibs.srcDir 'libs'
    jni.srcDirs = [] //disable automatic ndk-build call
}
</code></pre>

<p>}</p>