Android package generates the APK when the custom file name version number. Customizing Project fields and more

Source: Internet
Author: User

This configuration is in the early AS2.0 version:

Settings in app---->build.gradle

Applicationvariants.all {Variant                    -i = output.outputfile            if  null && outputFile.name.endsWith ('. apk ')) {                = "driver_${variant.productflavors[ 0].name}_v${defaultconfig.versionname}.apk "                new  File (outputfile.parent, FileName )            }        }    }

After 3.0 with the following configuration:

buildtypes {        debug{            //Modify debug State            Buildconfigfield "boolean", "Is_debug", "true"            Android.applicationVariants.all {variant-                Variant.outputs.all {                    outputfilename = "${appname}_${ variant.versionname}_debug.apk "                }            }        }        release {            //Modify debug State            Buildconfigfield" Boolean " , "Is_debug", "true"            minifyenabled false            proguardfiles getdefaultproguardfile (' Proguard-android-optimize.txt '), ' Proguard-rules.pro '            android.applicationVariants.all {variant                - Variant.outputs.all {                    outputfilename = "${appname}_${variant.versionname}_release.apk"}}        }    }

  

The Debug field also customizes the Project field

Android package generates the APK when the custom file name version number. Customizing Project fields and more

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.