Generate a .jks for the app with
keytool -genkey -v -keystore $FLUTTER_PROJECT_NAME/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
then encode the key with
base64 key.jks
and copy it in an environment variable in Travis-CI named PLAY_STORE_UPLOAD_KEY, add single quotes before and after the variable value.
Also add the password used for the key generation to an environment variable named UPLOAD_KEY_PASSWORD (single quotes here too).
Edit the $FLUTTER_PROJECT_NAME/android/app/build.gradle file like this:
...
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
...
defaultConfig {...}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias'] != null ? keystoreProperties['keyAlias'] : "key"
keyPassword keystoreProperties['keyPassword'] != null ? keystoreProperties['keyPassword'] : System.getenv("UPLOAD_KEY_PASSWORD")
storeFile file("../../key.jks")
storePassword keystoreProperties['storePassword'] != null ? keystoreProperties['storePassword'] : System.getenv("UPLOAD_KEY_PASSWORD")
}
}
buildTypes {
release {
//signingConfig signingConfigs.debug
signingConfig signingConfigs.release
}
}
}
...
Add a file at $FLUTTER_PROJECT_NAME/android/key.properties with the following content
storePassword=add_your_password_here
keyPassword=add_your_password_here
keyAlias=key
storeFile=../../key.jks
Generate a new oAuth access token in GitHub here and copy the value in an environment variable named GITHUB_TOKEN.
Install fastlane in your machine using
gem install fastlane -NV
then go to $FLUTTER_PROJECT_NAME/android and run
fastlane init
to setup fastlane in your project, enter the package name exactly as your applicationId in your $FLUTTER_PROJECT_NAME/android/app/build.gradle file.
Then create $FLUTTER_PROJECT_NAME/android/Gemfile with
source "https://rubygems.org"
gem "fastlane"
the run
bundle update
and add both Gemfile and Gemfile.lock to Git.
Then follow this guide to setup fastlane with your Play Console application.
Once completed copy the content of the downloaded JSON file and add it to the Travis-CI environment variables with name GOOGLE_CREDENTIALS (remember the single quotes before and after).
can i get video for this process