Expected a name but was STRING at line 1 column 99 path $[0].apkInfo.versionName : <p>I upgraded to gradle to 3.1.1 but now i want to change again to 3.0.1 but after changing to 3.0.1 i am getting this error</p>

<blockquote>
  <p>Expected a name but was STRING at line 1 column 99 path $[0].apkInfo.versionName</p>
</blockquote>

<p>I was using 3.0.1 before and it was working perfectly but i changed after android studio update.</p>

<p>The error is only coming when generating signed apk.</p>

<p><strong>Project Gradle</strong></p>

<pre><code>buildscript {

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'


    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

 allprojects {
repositories {
    google()
    jcenter()
    maven { url "https://jitpack.io" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
</code></pre>

<p><strong>App gradle</strong></p>

<pre><code>apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
    applicationId "com.smiles.smartstuddy"
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 4
    versionName "1.1"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
}
packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/ASL2.0'
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v13:27.1.1'
compile 'com.github.lzyzsd:circleprogress:1.2.1'
compile 'dev.dworks.libs:volleyplus:+'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'commons-io:commons-io:2.4'
compile 'com.github.bumptech.glide:glide:4.6.1'
compile 'es.voghdev.pdfviewpager:library:1.0.3'
 }
</code></pre>
