Setting up Android application Build Automation

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Setting up Android application Build Automation
Medium
~2-3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Android Build Automation Setup

By default, Gradle runs everything single-threaded. On projects with 15+ modules, cold builds take 4–7 minutes, incremental—90 seconds. In CI this becomes a queue blocking review. Build automation is not about "button in pipeline" but Gradle working predictably on any machine and producing signed AAB without manual steps.

Key Pain Points in Android Build Automation

Most common—APK/AAB signing in CI. Developers store keystore in repository (bad) or pass via command line in plain text (worse). Correct scheme: keystore Base64-encoded, in CI variable, decode to temporary file before build, delete after. In build.gradle.kts:

android {
    signingConfigs {
        create("release") {
            storeFile = file(System.getenv("KEYSTORE_PATH") ?: "debug.keystore")
            storePassword = System.getenv("KEYSTORE_PASSWORD") ?: "android"
            keyAlias = System.getenv("KEY_ALIAS") ?: "androiddebugkey"
            keyPassword = System.getenv("KEY_PASSWORD") ?: "android"
        }
    }
    buildTypes {
        release {
            signingConfig = signingConfigs.getByName("release")
            isMinifyEnabled = true
            proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
        }
    }
}

Build configuration by branch—second pain point. main → release AAB for Play Store, develop → debug APK with test endpoints, release/* → staging APK for QA. Implemented via buildFlavors + CI conditions, not separate build.gradle per environment.

Gradle caching in CI—separate story. Without cache, 200–400 MB dependencies download each time. With proper ~/.gradle/caches and ~/.gradle/wrapper caching—first build after build.gradle change takes full time, rest—incremental.

How We Set Up

Base stack: Gradle 8.x + AGP (Android Gradle Plugin) 8.x + GitHub Actions / GitLab CI / Bitrise. Fastlane for tasks Gradle can't handle: Google Play upload via supply, notifications, track management (internal → alpha → production).

Typical CI pipeline structure:

# .github/workflows/android-release.yml
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-java@v4
        with:
          java-version: '17'
          distribution: 'temurin'
      - name: Cache Gradle
        uses: actions/cache@v4
        with:
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
          key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
      - name: Decode Keystore
        run: echo "$KEYSTORE_BASE64" | base64 -d > app/release.keystore
        env:
          KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
      - name: Build Release AAB
        run: ./gradlew bundleRelease
        env:
          KEYSTORE_PATH: release.keystore
          KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
          KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
          KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: release-aab
          path: app/build/outputs/bundle/release/app-release.aab

Separately configure gradle.properties for CI: org.gradle.daemon=false (daemon not needed in CI), org.gradle.parallel=true, org.gradle.configureondemand=true. On projects with multiple modules this noticeably reduces configuration time.

Parallel Tasks and Optimization

Monolithic projects see little parallelization benefit. But modular architecture (:core, :feature-auth, :feature-feed, :app)—Gradle builds dependency graph and compiles independent modules in parallel. ./gradlew assembleDebug --parallel on 8-core agent gives noticeable boost.

For large teams, Gradle Build Cache makes sense—either Remote Build Cache via Gradle Enterprise (paid), or via build-cache plugin with S3 backend (open solution). Repeated tasks taken from cache, not recalculated.

Workflow

Audit current build.gradle → migrate to build.gradle.kts (if Groovy DSL) → setup signing config via environment variables → write CI configuration → setup caching → test on multiple branches → document for team.

Cost calculated individually. Timeline: 2–3 days for typical single-module project, up to 5 for multi-module with non-standard pipeline requirements.