flutter framework

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

How We Became a Top Mobile App Development Company in Columbus, Ohio

Sunflower Lab is a top mobile app development company in Columbus, Ohio for our integrity, exceptional solutions, and commitment to…

4 Ways Custom Software Development Can Help Startups

Investing in custom software development as a startup can be scary, but these 4 reason will likely convince you.

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!