Deploy Flutter App with Android Studio

Sign Flutter App in Android Studio

  1. Launch Flutter app with Android Studio
  2. Click Tools > Flutter > Open for Editing in Android Studio
  3. Let it load the build tools
  4. Click Build > Generate Signed Bundle/APK
  5. Click Next to Generate Sign App Key
  6. Select Release and click Finish

Create key.property file in project root folder

storePassword=password
keyPassword=passowrd
keyAlias=keyName
storeFile=C:\\Users\\xxxx\\Desktop\\storeKeyFileName.jks

Update build.gradle

[project]/android/app/build.gradle

Make no changes

 def keystoreProperties = new Properties()
    def keystorePropertiesFile = rootProject.file('key.properties')
    if (keystorePropertiesFile.exists()) {
        keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
    }


   signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
            storePassword keystoreProperties['storePassword']
        }
    }


    buildTypes {
        release {
           signingConfig signingConfigs.release
        }
    }
}

Generate Flutter Release Bundle

Once you have signed flutter app, reopen your flutter with Android Studio and build the app bundle

  1. Click Build > Flutter > Build App Bundle
Related:   The Sims Freeplay: get married and have a baby