How to Setup Gitlab CI-CD Pipeline for Flutter Applications: Part 2

Welcome back to How to Setup Gitlab CI-CD Pipeline for Flutter Applications. In Part 1, you learned how to configure a Flutter application with different flavors for both Android and iOS. 

In this part, we’re going to configure our Android and iOS modules with release configurations. Let’s get started!

Part 2 – Configure Android and iOS Release Modules

First, we’ll configure Android module step by step as below, 

  1. We need to create a keystore file which we can by following instruction from this link CLICK HERE.
  2. We need to reference this keystore in our application at location APP_DIR/android/key.properties which contain data as:

As we can see, we have to put our jks file created in step 1 in folder APP_DIR/ci-cd/android/jks/.jks  

3. Next, we have to cofigure signing in app/build.gradle file.  

  • Add Code before android block as shown below, which will load key.properties file into keystoreProperties object.

  Add code before buildTypes block, with signing configuration as below, and also update release buildType as same.

We’ll be also updating buildTypes with release configuration and optionally add debug as well as below:

That’s it. We’re done here from our side with signing configuration for Android module of our Flutter application. Now we’ll add same for our iOS module 

 

For iOS before we start, we need to create ExportOptions.plist file for all the schemes/flavors that we’ve defined in Part 1. We can create .plist file manually but instead of that we highly recommend to generate ExportOptions.plist file using XCode onlySo, let’s see how we can generate this plist file. 

 

  1. Setup the valid certificate and profile in “Signing & Capability” option.

2. Select develop scheme and keep Generic iOS Device aside to it as below, 

Now Product menu and select archive and let it perform operations to create archive. When it’s done move to next step.   

3. Select created archive and click on Export than select Development and click on next. Wait for it to create build and when asked export it to a particular location. When we’re done, we’ll move to next step.  

4. In exported destination folder we’ll find ExportOption.plist file. We’ll copy this file and paste it in path specified here APP_DIR/ci-cd/iOS/develop/debug/ 

5. At the end, we’ll generate archive in same way for production and export build at specific destination folder. In that folder we’ll find the ExportOption.plist file for production mode. We’ll copy this file and paste in path specified here APP_DIR/ci-cd/iOS/develop/release/ 

Here, we’re done with develop scheme/favour only & for production scheme select the production scheme with Generic iOS Device and repeat above 3 to 5 stepsWe’ll copy development and production ExportOption.plist file under same path specified before as APP_DIR/ci-cd/iOS/production/debug/ and APP_DIR/ci-cd/iOS/production/release/ respectively.  

 That’s it. We’re done here from our side to add signing configuration for iOS module of our Flutter application. In next & final part, we’ll see, what configurations and changes we’ve to make on Gitlab for our Flutter Project so we can enable and run build pipeline directly from it.  

 So, stay tuned for the final part!

Related Posts

Digital Transformation Strategy for 2022: First Steps, Benefits, Technology

Digital transformation is a movement to modify existing business processes to meet the needs to today’s digital age.

Android vs iOS Which Platform to Build Your App for?

Android vs iOS Which Platform to Build Your App for? Discover pros and cons, demographic information, pricing, development timeline, and…

#1 Mobile Application Development Company in New Jersey

Sunflower Lab is a mobile app development company in New Jersey. This is how we set ourselves apart from the competition.

Get a FREE estimate for your project today.

Our team of experts will review your project and give you a quote at no cost.

Get a quote on your project!
Published by
Janki Thaker

Recent Posts

  • Data & Analytics

Why is Databricks Lakehouse the Ultimate Data Solution for Your Company?

Businesses are forced to make compromises because of this…

2 days ago
  • AI/ML

The First Step in Using AI & Automation for Productivity

When adopting AI and automation, taking the time to…

5 days ago
  • Data & Analytics

7 Steps to Become Data Strategist & Drive Revenue Growth with Databricks

Without a strategy built by experts, your business could…

5 days ago
  • AI/ML

Your AI & Automation Strategy is the Outcome of 2 Key Steps

Strategically implementing AI & Automation can drive significant value,…

1 week ago
  • Data & Analytics

4 Important Things Decision-Makers Should Know About Data Analytics

Data-driven businesses are not only 23 times more likely…

1 week ago
  • Data & Analytics

7 Key Strategies for Building a Profitable Data Ecosystem with Databricks

Our key strategies for building a profitable data ecosystem…

2 weeks ago