Browse Source

Fix build errors

duke
Yusuf Sahin HAMZA 4 years ago
parent
commit
5967ecce1d
  1. 2
      .gitignore
  2. 16
      README.md
  3. 31
      app/build.gradle
  4. 4
      examples/secrets.properties

2
.gitignore

@ -58,5 +58,7 @@ freeline_project_description.json
secrets.properties secrets.properties
!examples/*
# vim # vim
*.sw? *.sw?

16
README.md

@ -64,7 +64,7 @@ Make sure you have Gradle 5.4.x or higher, 5.4.1 is known to work:
## Release Build Process ## Release Build Process
The first time you create a release build you'll need to create two files. The The first time you create a release build you'll need to create a keystore file and prepare a properties file. The
release keystore is used for app signing and a properties file is used to store release keystore is used for app signing and a properties file is used to store
sensitive information about the keystore. These files should not be committed sensitive information about the keystore. These files should not be committed
to git. Once you have both of these files you can create a release build for to git. Once you have both of these files you can create a release build for
@ -84,18 +84,10 @@ The `keytool` command can be used, for example:
* Set the Key Store Name to `silent_dragon_keystore.jks` and the path to that of the project, create a password for the keystore path, a Key alias, and a key password. The store password and key password should be the same. Fill out some basic organization information and click Ok. * Set the Key Store Name to `silent_dragon_keystore.jks` and the path to that of the project, create a password for the keystore path, a Key alias, and a key password. The store password and key password should be the same. Fill out some basic organization information and click Ok.
* On the next screen make sure the build variant "release" is selected and click Finish. * On the next screen make sure the build variant "release" is selected and click Finish.
### Creating a properties file ### Preparing properties file
Within the projects main directory create a file secrets.properties The Copy `secrets.properties` file from `examples` folder and paste it to the projects main directory.
contents of the file are below and filled in with the release keystore alias, Fill store_file_location, key_alias, key_password and store_password when you created the release keystore.
key password, and store password from when you created the release keystore.
```
store_file_location=../silent_dragon_keystore.jks
key_alias=<alias>
key_password=<key_password>
store_password=<store_password>
```
### Building a release APK for Google Play ### Building a release APK for Google Play

31
app/build.gradle

@ -5,13 +5,6 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream((secretsPropertiesFile)))
}
android { android {
compileSdkVersion 28 compileSdkVersion 28
@ -25,14 +18,8 @@ android {
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }
signingConfigs { signingConfigs {
release { release
storeFile file(secretProperties["store_file_location"])
keyAlias secretProperties["key_alias"]
keyPassword secretProperties["key_password"]
storePassword secretProperties["store_password"]
}
} }
buildTypes { buildTypes {
@ -45,6 +32,22 @@ android {
} }
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
android.signingConfigs.release.storeFile = file(secretProperties["store_file_location"])
android.signingConfigs.release.keyAlias = secretProperties["key_alias"]
android.signingConfigs.release.keyPassword = secretProperties["key_password"]
android.signingConfigs.release.storePassword = secretProperties["store_password"]
android.buildTypes.release.signingConfig = android.signingConfigs.release
} else {
android.buildTypes.release.signingConfig = null
}
dependencies { dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

4
examples/secrets.properties

@ -0,0 +1,4 @@
store_file_location=../silent_dragon_keystore.jks
key_alias=<alias>
key_password=<key_password>
store_password=<store_password>
Loading…
Cancel
Save