title: Android Gradle: Cannot set the value of read-only property 'outputFile'
body: <p>I downloaded an <code>Android</code> project from <code>github</code> by sunmi printer, to test my pos printer, but when start the build and <code>sync</code> the <code>project</code> it give me this <code>gradle error</code>:</p>
  
  <blockquote>
    <p>ERROR: Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{apkData=Main{type=MAIN, fullName=debug, filters=[], versionCode=9, versionName=v2.7.2}} of type com.android.build.gradle.internal.api.ApkVariantOutputImpl.</p>
  </blockquote>
  
  <p>Here the Gradle:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      signingConfigs {
          release {
              keyAlias 'key0'
              keyPassword '123456'
              storeFile file('../app/temp.jks')
              storePassword '123456'
          }
          debug {
              keyAlias 'key0'
              keyPassword '123456'
              storeFile file('../app/temp.jks')
              storePassword '123456'
          }
      }
  
      compileSdkVersion 23
      buildToolsVersion "23.0.3"
      defaultConfig {
          applicationId "com.test.printertestdemop1"
          minSdkVersion 21
          targetSdkVersion 23
          versionCode 9
          versionName "v2.7.2"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      lintOptions {
          abortOnError false
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
              signingConfig signingConfigs.release
          }
      }
  
      android.applicationVariants.all {
          variant -&gt;
              variant.outputs.each {
                  output -&gt; output.outputFile = new File(output.outputFile.parent, "PrinterDemo_" + defaultConfig.versionName + "_P1.apk");
              }
      }
  
  
  }
  
  dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation 'com.android.support:appcompat-v7:23.3.0'
      implementation 'com.android.support:recyclerview-v7:23.3.0'
      implementation 'com.sunmi:sunmiui:latest.release'
      implementation files('libs/core-3.3.0.jar')
  }
  </code></pre>