Skip to content

Building Flutter Android on AppVeyor

Feodor Fitsner edited this page Aug 3, 2023 · 2 revisions

Installing Fastlane

Switch to <flutter-app-root>/android directory:

cd ios

Create Gemfile with the following contents:

source "https://rubygems.org"

gem "fastlane"

Create .bundle/config with the following contents:

---
BUNDLE_PATH: "vendor/bundle"

Append the following line to .gitignore:

vendor/

Run the following command to install Fastlane and Cocoapods:

bundle install --path vendor/bundle

Run this in case of JSON native compilation error:

xcode-select --install

Gemfile.lock must be checked into repository - that will ensure you have the same versions in CD environment.

Always run Fastlane with bundle exec fastlane <args> command. Let's check the version of installed Fastlane:

bundle exec fastlane --version

Every time you need to update Fastlane to the latest version run:

bundle update fastlane

Configure app signing

Build a signed release:

flutter build appbundle --build-name 0.0.1 --release

Go to Google Play Console, click "Internal release" and upload created .aab file.

Check upload certificate on "App signing" page.

Configure supply.

Init Fastlane by running:

bundle exec fastlane init

A new fastlane directory will be create with two files in it:

  • Appfile - the information about your app, such as app_identifier.
  • Fastfile - file with build targets or "lanes".

Update Appfile and change app_identifier with your App's ID, e.g. com.{your-company}.{your-product}.

Leave the contents of Fastfile as is for now.

Configure Java Key Store (.jks) for CI

base64 -i ~/upload-keystore.jks

Set encoded content to JKS_BASE64 environment variable.

Configure supply JSON key for CI

base64 -i ~/flet-supply-gcp-service-account.json