Last active
July 23, 2019 07:00
-
-
Save TheDancerCodes/3ee23c33320052e5a9f6cf472256819e to your computer and use it in GitHub Desktop.
A build.gradle file containing code for generating a release APK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
... | |
// Create a variable called keystorePropertiesFile, and initialize it to your | |
// keystore.properties file, in the rootProject folder. | |
def keystorePropertiesFile = rootProject.file("keystore.properties") | |
// Initialize a new Properties() object called keystoreProperties. | |
def keystoreProperties = new Properties() | |
// Load your keystore.properties file into the keystoreProperties object. | |
keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) | |
android { | |
... | |
signingConfigs { | |
release { | |
keyAlias keystoreProperties['keyAlias'] | |
keyPassword keystoreProperties['keyPassword'] | |
storeFile file(keystoreProperties['storeFile']) | |
storePassword keystoreProperties['storePassword'] | |
} | |
} | |
buildTypes { | |
release { | |
minifyEnabled false | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
// Using a signing config in a release build | |
signingConfig signingConfigs.release | |
} | |
} | |
} | |
dependencies { | |
// Your dependencies go here. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment