I have created an app in flutter using Android studio which I want to deploy.
Flutter version is 2.10.
Dart version is 2.16.0.
When I run or debug main.dart from Android studio everything works as expected. I have signed the application following the instructions from here:
https://docs.flutter.dev/deployment/android
I have created the keystore using the following command:
"C:\Program Files\Android\Android Studio\jre\bin\keytool" -genkey -v -keystore c:\upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
Created key.properties file with the following content
storePassword=password from previous step
keyPassword=password from previous step
keyAlias=key
storeFile=location of the key store file, such as /Users/<user name>/upload-keystore.jks
in [project]/android/app/build.gradle added the keystore information before the Android block as follow
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
and replaced
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now,
// so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
with
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
And after changing the gradle file I ran flutter clean. After the specified steps the application can still the debugged and can be ran as expected. I am building a bundle with the following command
flutter build appbundle
The build is successful and I get the output file in
build\app\outputs\bundle\release\app-release.aab
Using bundletool I convert the .aab file to apks and install it on my phone with the following commands:
java -jar "PATH/bundletool-all-1.8.2.jar" build-apks --bundle=PATH/app-release.aab --ks="PATH/upload-keystore.jks" --ks-key-alias=key --output=PATH/app-release.apks
java -jar "PATH/bundletool-all-1.8.2.jar" install-apks --apks=PATH/app-release.apks
where PATH is the path to the directory of the file. After the app is being installed and launched I get the attached window
which is completely different than the app I wrote.
Can someone please tell me what am I doing wrong?
Best regards, Stanko

flutter runcommand?