Muvi Blogs

Beyond The Buzz- Latest Insights From Muvi

Please wait while we enable your Account

0%

Contacting Amazon Web Services
Deploying Cloud Servers, Storage, Transcoding & Database Servers
Deploying Global CDN
Deploying Firewall & Enabling Security Measures
Deploying the CMS & Admin Module
Deploying Website, Mobile & TV Apps framework
Creating your FTP account
Finishing up all the modules
Preparing for launch

How to Sign & Deploy Your Flutter App? 01 April 2021

Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.

  1. Generate your Keystore

Every app needs to be digitally signed by its own keystore (a .jks file) before being uploaded to Google or Apple. When you deploy newer versions, they will use the digital signature to verify the authenticity of the upload. Therefore DO NOT lose this file and DO NOT check it into version control, keep a copy of it somewhere safe. If you lose this file, you will need to generate a new one and contact Google and Apple to get it verified. Prepare and write down a key password and store password, you will need to use this in the next step Run the following command to generate your keystore file. Make sure you replace muviteam with the name of your app in both the keystore argument and the alias argument. After running this command your file will be saved in ~ or C:/Users/USER_NAME change the directory if desired.

Run the following command to generate your keystore on Mac/Linux:

Run this on Windows (replace USER_NAME with your username):

2. Create Keystore properties file

Create a new file {project-root}/android/key.properties with the following and replace each field with the details from the previous step. DO NOT check this file into version control.

3. Update build.gradle

  1. Set compileSdkVersion, minSdkVersion , and targetSdkVersion to 28. See the documentation for correct Android versioning.
  2. Open {project-root}/android/app/build.gradle
  3. Under defaultConfig, replace the buildTypes block with this fragment of code (use androidx.fragment:fragment:1.0.0 instead of com.android.support:support-fragment:28.0.0 when using AndroidX):

4.   Add this in app/build.gradle

4. Update Pubspec.yaml

Open pubspec.yaml and update the version, the first part before the + sign is the version name, I recommend using semantic versioning. And increment the number after the + sign, it is the version code and if it is not updated Google/Apple could reject your APK. Please see https://flutter.dev/docs/deployment/android#updating-the-apps-version-number for more information.

Typically I like to update my version name semantically, either incrementing the major or minor number like 1.1.0 -> 1.2.0, if it has breaking changes 1.1.0 -> 2.0.0, etc. And I always increment the version number like +1 to +2.

5. Build and upload APK to Google Play

  1. Run this in the command line in your project root flutter clean && flutter build app bundle –release, this could take up to 10 minutes, don’t freak out.
  2. Login to Google Play Console
  3. Click on ‘Release Management’ on the left-hand side, then ‘App releases’
  4. Then create a new release, and fill in the details, I like to use the version name as the release name.
  5. Upload your appbundle files in this directory: {project-root}/build/app/output/bundle/release/app-release.aab
  6. Practice your Google skills to fix any issues
  7. Party!!!

Subsequent Deployments

  1. Update version name and version number in pubspec.yaml
  2. Run flutter clean && flutter build appbundle –release
  3. Go to Google Play Console -> Release Management -> Create new release
  4. Upload new {project-root}/build/app/output/bundle/release/app-release.aab files
  5. Check In changes

Don't forget to share this post!


Debashish Mahato
Debashish is an Android Developer in the Customer Success Team at Muvi. He has 4+ years of experience in Mobile App Development. A wannabe blogger at heart, in his free time, you may either find him reading books on entrepreneurship or listening to tech podcasts.

Latest Posts

Try Muvi One free for 14 days

No Credit Card Required

.muvi.com
Your website will be at https://yourname.muvi.com, you can change this later.

Related Blogs
Connected TV (CTV) Advertising: All You Need To Know

Connected TV (CTV) Advertising: All You Need To Know

  Connected TV (CTV) advertising refers to the practice of delivering video ads to viewers on internet-connected televisions (TVs), rather...

31 January 2023
How to Develop Your Own LG TV WebOS App Without Coding?

How to Develop Your Own LG TV WebOS App Without Coding?

  In 2021, LG TVs held an 18.9% share of the global television market. We don’t need to tell you...

20 January 2023
OTT Business Model 2023 - How OTT Platforms Make Money?

OTT Business Model 2023 - How OTT Platforms Make Money?

  Are you eager to know about How OTT platforms make money? In this blog, we will discuss how OTT...

18 January 2023
What Are The Different Types of Cyber Attacks on OTT Platforms?

What Are The Different Types of Cyber Attacks on OTT Platforms?

  Cybercrimes were predicted to inflict damages amounting to US$ 6 trillion in 2021. In that scenario, cybercrime would have...

17 January 2023
A Complete Guide to Growing Your Video Membership Site

A Complete Guide to Growing Your Video Membership Site

  The demand for video membership sites has grown exponentially over the past few years making it a highly profitable...

17 January 2023

Try Muvi One
Free for 14 days

Launch your Multi-Screen Streaming Service
Instantly
START FREE
close-link