Github RemoteMonster/android-sdk/examples/full 을 해보려고 합니다.
build.gradle(Module:app)의 32라인에서
output.outputFile.name.replace(".apk", “-${variant.versionName}.apk”))
아래와 같은 에러가 발생하는데 어떻게 해야되는지요?
Error:(32, 0) Cannot set the value of read-only property ‘outputFile’ for ApkVariantOutputImpl_Decorated{apkData=Main{type=MAIN, fullName=debug, filters=[]}} of type com.android.build.gradle.internal.api.ApkVariantOutputImpl.
Open File
build.gradle(Module:app)
plugins {
id ‘com.gladed.androidgitversion’ version ‘0.2.21’
}
apply plugin: ‘com.android.application’
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId “com.remon.example.fullfeatures"
archivesBaseName = “remotemonster-fullfeatures"
minSdkVersion 21
targetSdkVersion 25
versionName androidGitVersion.name()
versionCode androidGitVersion.code()
testInstrumentationRunner “android.support.test.runner.AndroidJUnitRunner”
}
packagingOptions{
exclude ‘/META-INF/LICENSE’
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.pro’
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFile = new File(
output.outputFile.parent,
output.outputFile.name.replace(”.apk”, “-${variant.versionName}.apk”))
}
}
}
dependencies {
compile fileTree(dir: ‘libs’, include: [’*.jar’])
androidTestCompile(‘com.android.support.test.espresso:espresso-core:2.2.2’, {
exclude group: ‘com.android.support’, module: ‘support-annotations’
})
compile 'com.android.support:appcompat-v7:25.0.0’
testCompile 'junit:junit:4.12’
compile(group: ‘com.remon’, name: ‘remondroid’, version: ‘0.2.48’)
}