DEV – Change the gradle.build file in Android Studio to generate APKs matching our naming conventions

Short tutorial on how to change the gradle.build file in Android Studio to generate APKs matching our naming conventions.
I created also the naming convention on the fly 😉

While building the Android Wrapper for the first release of the BabySleepSweet sideproject I realized, that the APK name can not be changed as easy in the Android Studio environment as I remember the process in Eclipse.

So I googled some things and finally found 2 very good answers. (I used the first answer of the second link to “adopt” my gradle build.
Details can be found on the shared folder:
E:\00_today\2017-03-01-files\LOCAL_ADB_Fire_Wrapper_4YT_2017-03-01\BabySleepSweet\app\build.gradle

Or in my N2K System. (5581)

http://stackoverflow.com/questions/28249036/app-release-apk-how-to-change-this-default-generated-apk-name

Here I got my answer!
http://stackoverflow.com/a/40016854/3568782
dependencies are not in the main block. (Separate block)

In Android Studio:
Android View – Gradle Scripts – 2x build.gradle. I modified the Project build.gradle.


release {
//minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

did not work like in the tutorial… so this is already what worked for me.

Leave a Reply