Pit APK packaging after Android studio 3.6 upgrade

I tried the latest version of Android studio 3.6 some time ago. On the whole, gradle debugging has a better experience than the historical version.

There happened to be a new project that directly used the latest version. In addition to maintaining the original interface style, this new version of the upgrade mainly focused on the short board problem of optimizing the compilation speed, so the new project was developed and completed soon. However, there was a little episode when packing. Let's take a look at the effect picture after packing twice.

It's strange that the newly packaged APK overwrites the previously packaged APK. What did I do?

So I began to check the relevant configuration in build.gradle. The relevant code related to file packaging is still written in the old version, which is roughly as follows.

 1 android.applicationVariants.all { variant ->
 2     variant.outputs.all { output ->
 3         def outputFile = output.outputFile
 4         if (outputFile != null && outputFile.name.contains('release')) {
 5             def fileName = "${rootProject.name}${android.defaultConfig.versionName}_${releaseTime()}.apk"
 6             println print apk name:" + fileName
 7             outputFileName = 8         }
 9     }
10 }

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>