<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Precious Chima on Medium]]></title>
        <description><![CDATA[Stories by Precious Chima on Medium]]></description>
        <link>https://medium.com/@codekeyz?source=rss-3641ef8bf074------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*PovGQ8RngkvLctrr.jpg</url>
            <title>Stories by Precious Chima on Medium</title>
            <link>https://medium.com/@codekeyz?source=rss-3641ef8bf074------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 08:24:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@codekeyz/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Setup Gitlab CI in Flutter-Android Project]]></title>
            <link>https://medium.com/@codekeyz/setup-gitlab-ci-in-flutter-android-project-89f6628828e8?source=rss-3641ef8bf074------2</link>
            <guid isPermaLink="false">https://medium.com/p/89f6628828e8</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[gitlab-ci]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Precious Chima]]></dc:creator>
            <pubDate>Sat, 18 May 2019 05:49:10 GMT</pubDate>
            <atom:updated>2019-07-01T09:52:36.225Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*aCCoa2vEacPdSCFMhyFtgA.jpeg" /><figcaption><a href="https://codemagic.io/">https://codemagic.io/</a></figcaption></figure><p>Integrating Gitlab CI in your Flutter Project can be a very stressful &amp; boring task. I want to share with you, how i was able to successfully setup Gitlab CI in my Flutter Project after many failed trials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nftPZmz-aM0vby4733fCuA.jpeg" /><figcaption>Looking at the Failed Pipelines as if could delete the logs made by Gitlab-Slack Incoming Webhook in my workspace.</figcaption></figure><p><strong>Step 1:</strong> <strong>Create </strong><strong>.gitlab-ci.yml file</strong></p><p>In the root of your flutter project, create a .gitlab-ci.yml file</p><p><strong>Step 2: Setup Docker Image</strong></p><pre>image: openjdk:8-jdk</pre><p>We are defining a Docker Image (<em>openjdk:8-jdk</em>). The TL;DR is that it allows us to setup temporary isolated version of a virtual operating system running in its own <a href="https://www.sdxcentral.com/cloud/containers/definitions/what-is-docker-container-open-source-project/">container</a> environment for building and testing.</p><p><strong>Step 3: Define Variables</strong></p><pre>variables:  <br>  ANDROID_COMPILE_SDK: &quot;28&quot;  <br>  ANDROID_BUILD_TOOLS: &quot;28.0.2&quot;    <br>  ANDROID_SDK_TOOLS:   &quot;4333796&quot;<br>  FLUTTER_VERSION: &quot;https://storage.googleapis.com/flutter_infra/releases/stable/linux/flutter_linux_v1.2.1-stable.tar.xz&quot;</pre><p>Basically, we are defining variables we will be using throughout the lifetime of our script. You can configure them to match the properties you predefined in your app-level <em>build.gradle </em>file.</p><p><strong>Step 4: Installing Packages</strong></p><pre>before_script:  <br>   - apt-get --quiet update --yes  <br>   - apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1</pre><p>This block starts a bunch of commands that will be executed before each job in our config runs. We’re installing wget, tar, unzip, and some other packages that are needed in our environment.</p><p>Installing &amp; Setting up the Android SDK</p><pre># android sdk setup <br>   - wget --quiet --output-document=android-sdk.zip <a href="https://dl.google.com/android/repository/sdk-tools-linux-$%7BANDROID_SDK_TOOLS%7D.zip">https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip</a><br>   - unzip -d android-sdk-linux android-sdk.zip<br>   - echo y | android-sdk-linux/tools/bin/sdkmanager &quot;platforms;android-${ANDROID_COMPILE_SDK}&quot; &gt;/dev/null<br>   - echo y | android-sdk-linux/tools/bin/sdkmanager &quot;platform-tools&quot; &gt;/dev/null<br>   - echo y | android-sdk-linux/tools/bin/sdkmanager &quot;build-tools;${ANDROID_BUILD_TOOLS}&quot; &gt;/dev/null<br>   - export ANDROID_HOME=$PWD/android-sdk-linux<br>   - export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/<br># temporarily disable checking for EPIPE error and use yes to accept all licenses<br>   - set +o pipefail<br>   - yes | android-sdk-linux/tools/bin/sdkmanager --licenses<br>   - set -o pipefail</pre><p>Installing &amp; Setting up the Flutter SDK</p><pre># flutter sdk setup  <br>   - wget --output-document=flutter-sdk.tar.xz $FLUTTER_VERSION<br>   - tar -xf flutter-sdk.tar.xz  <br>   - export PATH=$PATH:$PWD/flutter/bin  <br>   - echo flutter.sdk=$PWD/flutter &gt; android/local.properties  <br>   - chmod +x ./android/gradlew</pre><p>Do note that you can change the flutter version.</p><p><strong>Step 5: Defining Stages</strong></p><pre>stages:  <br>   - test <br>   - build</pre><p>We’re defining our build stages, a group of jobs that happen in parallel and also run sequentially.</p><p><strong>Step 6: Building the Application</strong></p><pre>build:apk:<br>  stage: build<br>  script:<br>    - flutter build apk<br>  artifacts:<br>    paths:<br>     - build/app/outputs/apk</pre><pre>build:bundle:<br>  stage: build<br>  script:<br>    - flutter build appbundle<br>  artifacts:<br>    paths:<br>      - build/app/outputs/bundle</pre><p>This defines two jobs called build:apk and build:bundle that runs during the build stage. Nothing too crazy here about setting something simple like this up!</p><p><strong>Step 7: Running Tests</strong></p><pre>test:android:<br>  stage: test<br>  script:<br>    - cd android<br>    - ./gradlew -Pci --console=plain :app:testDebug</pre><pre>test:flutter:<br>  stage: test<br>  script:<br>    - flutter test</pre><p>This defines our second job called test , consisting of two parts;<strong> </strong><a href="https://developer.android.com/studio/write/lint"><strong>an android linter</strong></a>; the other part being and a <a href="https://flutter.dev/docs/testing"><strong>flutter test runner</strong></a>.</p><p><strong>Step 8: Check your </strong><strong>.gitignore</strong></p><p>Open up the <strong>.gitignore </strong>file in the root of your flutter project. Make sure that the following files aren’t ignored and are pushed together with your code.</p><ol><li>**/android/**/gradle-wrapper.jar</li><li>**/android/gradlew</li><li>**/android/gradlew.bat</li></ol><p><strong>Step 9: Run your new CI Setup</strong></p><p>After you’ve added your new .gitlab-ci.yml file to the root of your directory, just push your changes and off you go! You can see your running builds in the <strong>Pipelines</strong> tab of your project. You can even watch your build execute live and see the runner&#39;s output, allowing you to debug problems easily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Opm1-IGGQbKc7y6qVdzm4g.jpeg" /><figcaption>Wow, this is great, Cheers</figcaption></figure><p>I created this Github gist to help you get going fast with the CI setup.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d8c6ec7b66e33d9ee67e6b1bf4b7f4a4/href">https://medium.com/media/d8c6ec7b66e33d9ee67e6b1bf4b7f4a4/href</a></iframe><p><strong>With gratitude</strong></p><p>I really appreciate the Gitlab Team for putting a great helpful article on <a href="https://about.gitlab.com/2018/10/24/setting-up-gitlab-ci-for-android-projects/">Setting Up Gitlab CI for Android Projects</a> which was a great start for coming up with this post.</p><p>Let’s hook up and be friends via these handles</p><ul><li><a href="https://github.com/codekeyz">codekeyz - Overview</a></li><li><a href="https://twitter.com/code_keyz">Chima Precious (@code_keyz) | Twitter</a></li><li><a href="https://www.linkedin.com/in/chimaprecious/">Chima Precious - Mobile Applications Developer - Working IT Solutions | LinkedIn</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89f6628828e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>