I downloaded an Android
project from github
by sunmi printer, to test my pos printer, but when start the build and sync
the project
it give me this gradle error
:
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.
Here the Gradle:
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 ->
variant.outputs.each {
output -> 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')
}