android studio 3.1: build:gradle:3.1.0 - Absolute path are not supported when setting an output file name

后端 未结 7 930
囚心锁ツ
囚心锁ツ 2020-12-05 19:32

When I use Android Studio 3.0 and I use the next version of Android Gradle Plugin in project/build.gradle:

cl         


        
7条回答
  •  粉色の甜心
    2020-12-05 19:45

    If you want to append the version name and version code do it like:

    applicationVariants.all { variant ->
            variant.outputs.all {
                def versionName = variant.versionName
                def versionCode = variant.versionCode
                def variantName = variant.name
                outputFileName = "${rootProject.name}" + '_' + variantName + '_' + versionName + '_' + versionCode + '.apk'
            }
        }
    

提交回复
热议问题