Android stdio automatically generated by default the name of the app is App-release or App-debug, after the build and manually change the name of the APK, it is very troublesome.
How to customize the name of the APK: Add the following to the \app\build.gradle file
Apply plugin: ' Com.android.application 'def getTime () {return NewDate (). Format ("YyyyMMdd", Timezone.getdefault ());} Android {compilesdkversion22buildtoolsversion"25.0.2"Defaultconfig {ApplicationID"Com.example.myapplication"minsdkversion19targetsdkversion22Versioncode1Versionname"1.0"} buildtypes {release {minifyenabledfalseproguardfiles Getdefaultproguardfile (' Proguard-android.txt '), ' Proguard-rules.pro ' } } //app name after packagingApplicationvariants.all {variant-Variant.outputs.each {Output-def OutputFile=output.outputfile def fileNameif(OutputFile! =NULL&& outputFile.name.endsWith ('. apk '))) { if(Variant.buildType.name.equals (' release ')) ) {FileName= "Loverheart_release${defaultconfig.versionname}.${gettime ()}.apk" } Else if(Variant.buildType.name.equals (' Debug ') ) {FileName= "Loverheart_debug${defaultconfig.versionname}.${gettime ()}.apk"} output.outputfile=NewFile (Outputfile.parent, FileName)}} }}dependencies {Compile filetree (dir:' Libs ', include: [' *.jar ']) Testcompile' junit:junit:4.12 'Compile' com.android.support:appcompat-v7:22.2.1 'Compile' com.android.support:design:22.2.1 '}
The generated APK package is named: loverheart_release1.0.20170417.apk
Android Stdio How to customize the build apk name