In the Build.gradle file, configure it under the Android node.
Android {compilesdkversion buildtoolsversion ' 22.0.1 ' signingconfigs {release {keyalias ' xxx ' Keypassword ' xxxxxxxxxxxx ' storefile file ('./xxx.keystore ') Storepassword ' xxxxxxxxx xxxxxxx '} config {keyalias ' xxxx ' keypassword ' xxxxxxx ' StoreFile file ('. /xxx.keystore ') Storepassword ' xxxxxxxx '}} defaultconfig {ApplicationID "com.xxx.xxxxx" Minsdkversion targetsdkversion versioncode 7 versionname "2.2.1" Signingconfig si Gningconfigs.release}//Configure debug mode, use the official version of the signature, this operation is mainly for the convenience of debugging, Sina and other third-party login authorization Buildtypes {release {minif yenabled true Proguardfiles getdefaultproguardfile (' proguard-android.txt '), ' Proguard-rules.pro ' Deb uggable true Signingconfig signingconfigs.release} debug {signingconfig signingconfi Gs.release}} Channel Productflavors {baidu {manifestplaceholders = [umeng_channel_value: "Baidu"]} qihu360 {manifestplaceholders = [umeng_channel_value: "qihu360"]} Tencent {Manif Estplaceholders = [Umeng_channel_value: "Tencent"]}} sourcesets {main {java.srcdirs = [' src/main/j Ava ', ' src/main/java/jnilibs ', ' Src/main/jnilibs '}}//Modify the generated apk name Applicationvariants.all {variant- Variant.outputs.each {OUTPUT, def oldFile = Output.outputfile if (variant.buildType.name.equ ALS (' release ')) {def releaseapkname = ' Pintuan_ ' + variant.productflavors[0].name + ' _release_ ' + DEFAULTC Onfig.versionname + '. apk ' output.outputfile = new File (oldfile.parent, Releaseapkname)} } }}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android Studio Build.gradle Configuration, use the official version signature in debug mode, rename apk