Could not find com.google.android:flexbox:2.0.1 Error in Flutter Android Build on CircleCI

I’m facing an issue with my Flutter Android build on CircleCI where it fails with the following error:

Execution failed for task ':app:androidDependencies'.
> Could not resolve all artifacts for configuration ':app:prodDebugCompileClasspath'.
   > Could not find com.google.android:flexbox:2.0.1.
     Required by:
         project :app

Here’s the relevant part of my android/app/build.gradle:

android {
    ...
    flavorDimensions "default"

    productFlavors {
        staging {
            dimension "default"
            applicationIdSuffix ".staging"
            manifestPlaceholders = [appName: "App Staging", isStaging: true, isProduction: false]
        }
        prod {
            dimension "default"
            applicationIdSuffix ""
            manifestPlaceholders = [appName: "App", isStaging: false, isProduction: true]
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.0"
    implementation 'com.google.firebase:firebase-messaging:21.0.0'
    implementation 'com.polidea.rxandroidble2:rxandroidble:1.11.1'
    implementation "com.google.android.material:material:1.5.0"
    implementation 'androidx.window:window:1.0.0'
    implementation 'androidx.window:window-java:1.0.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.google.android:flexbox:2.0.1' // added this to implementation
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
}

and I’ve also tried to add a combination on these in android/build.gradle

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
        maven { url 'https://maven.google.com' }
        jcenter() // Note: jcenter is deprecated but can still be used for legacy dependencies
    }
}

Where I’ve added mavenCentral() and maven { url 'https://maven.google.com' } but nothing works there.

Context:

  • I am using a Zoom SDK bridge in my Flutter app. (version 5.16.6)
  • The error occurs during the CircleCI build process but not on local builds.
  • Running ./gradlew clean build --refresh-dependencies doesn’t seem to work.

my CircleCI config:

version: "2.1"
orbs:
  flutter: circleci/[email protected]
  android: circleci/[email protected]
  macos: circleci/[email protected]

parameters:
  manual-staging-run:
    type: boolean
    default: false

workflows:
  build:
    jobs:
      - lint_and_test:
          filters:
            branches:
              ignore:
                - staging
                - main
  deploy_staging:
    jobs:
      - lint_and_test:
          filters:
            branches:
              only: staging
      - deploy_staging_ios:
          requires:
            - lint_and_test
      - deploy_staging_android:
          requires:
            - lint_and_test
  deploy_prod:
    jobs:
      - lint_and_test:
          filters:
            branches:
              only: main
      - deploy_prod_ios:
          requires:
            - lint_and_test
      - deploy_prod_android:
          requires:
            - lint_and_test
  manual_deploy_staging:
    when: << pipeline.parameters.manual-staging-run >>
    jobs:
      - lint_and_test
      - deploy_staging_ios:
          requires:
            - lint_and_test
      - deploy_staging_android:
          requires:
            - lint_and_test

commands:
  setup_env:
    steps:
      - checkout
      - flutter/install_sdk_and_pub:
          version: 3.19.5
      - run:
          name: Install Zoom SDK
          command: flutter pub run zoom:unzip_zoom_sdk
  run_fastlane:
    parameters:
      fastlane_lane:
        default: "staging_release"
        type: string
      platform:
        default: ""
        type: string
    steps:
      - run:
          no_output_timeout: 50m
          name: Fastlane
          command: bundle exec fastlane <<parameters.fastlane_lane>> build_number:$CIRCLE_BUILD_NUM
          working_directory: <<parameters.platform>>
  build_ios:
    parameters:
      fastlane_lane:
        default: "staging_release"
        type: string
      output_dir:
        default: output
        type: string
    steps:
      - setup_env
      - flutter/install_ios_pod
      - flutter/install_ios_gem:
          cache-version: v1.1
      - run: echo "$APP_STORE_API_KEY_JSON" | base64 --decode > ios/key_file.json
      - run_fastlane:
          fastlane_lane: <<parameters.fastlane_lane>>
          platform: ios
      - store_artifacts:
          path: <<parameters.output_dir>>
          destination: outputs
  build_android:
    parameters:
      flavor:
        default: staging
        type: string
      output_dir:
        default: output
        type: string
    steps:
      - setup_env
      - flutter/install_android_gradle_dependencies
      - flutter/install_android_gem
      - run: echo "$PLAY_STORE_UPLOAD_KEY" | base64 --decode > android/app-keystore
      - run: echo "$PLAY_STORE_UPLOAD_KEY_INFO" | base64 --decode > android/key.properties
      - run: echo "$SUPPLY_JSON_KEY_DATA" > android/play-store-credentials.json
      - run_fastlane:
          fastlane_lane: <<parameters.flavor>>_release
          platform: android
      # - run_fastlane:
      #      fastlane_lane: <<parameters.flavor>>_apk
      #      platform: android
      - store_artifacts:
          path: <<parameters.output_dir>>
          destination: outputs

jobs:
  deploy_staging_android:
    description: Deploy Staging build to internal testers in Play Store
    executor:
      name: android/android-machine
      tag: 2024.01.1
    steps:
      - build_android:
          flavor: staging
          output_dir: android/build/app/outputs/flutter-apk/app-staging-release.apk

  deploy_prod_android:
    description: Deploy Prod build to internal testers in Play Store
    executor:
      name: android/android-machine
      tag: 2024.01.1
    steps:
      - build_android:
          flavor: prod
          output_dir: android/build/app/outputs/flutter-apk/app-prod-release.apk

  deploy_staging_ios:
    description: Deploy Staging build to TestFlight
    macos:
      xcode: 15.3.0
    resource_class: macos.m1.medium.gen1
    environment:
      HOMEBREW_NO_AUTO_UPDATE: 1
    steps:
      - run: brew install graphicsmagick
      - run:
          command: |
            #!/usr/bin/env bash
            if [ "$(uname -m)" = "arm64" ]; then
                /usr/sbin/softwareupdate --install-rosetta --agree-to-license
            else
                echo "Rosetta 2 can only be installed on Apple Silicon!"
                exit 1
            fi
          name: Installing Rosetta 2

      - build_ios:
          fastlane_lane: staging_release

  deploy_prod_ios:
    description: Deploy Prod build to TestFlight
    macos:
      xcode: 15.3.0
    resource_class: macos.m1.medium.gen1
    steps:
      - run:
          command: |
            #!/usr/bin/env bash
            if [ "$(uname -m)" = "arm64" ]; then
                /usr/sbin/softwareupdate --install-rosetta --agree-to-license
            else
                echo "Rosetta 2 can only be installed on Apple Silicon!"
                exit 1
            fi
      - build_ios:
          fastlane_lane: pre_release

  lint_and_test:
    description: Run flutter analyze and Unit Tests
    docker:
      - image: "ghcr.io/cirruslabs/flutter:3.19.5"
    steps:
      - checkout
      - flutter/install_pub
      - run: echo 'export PATH="$PATH":"$HOME/.pub-cache/bin"' >> $BASH_ENV
      - run:
          name: Install junitreport
          shell: "/bin/bash --login -eo pipefail"
          command: dart pub global activate junitreport
      - run: mkdir test-results
      - run:
          name: Run flutter analysis
          command: flutter analyze
      - run:
          name: Run Unit Test
          command: flutter test --machine | tojunit -o test-results/unit-test-report.xml
      - store_test_results:
          path: test-results

How can I resolve the Could not find com.google.android:flexbox:2.0.1 error in my CircleCI build process? Are there any additional steps I should take to ensure that the dependencies are correctly resolved in the CI environment?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật