Gradlew unable to assemble in my local runner

variables:
  LANG: "en_US.UTF-8"
  ANDROID_COMPILE_SDK: "33"
  ANDROID_BUILD_TOOLS: "33.0.3"
  ANDROID_SDK_TOOLS: "9477386"

clean-build-job:         
stage: build
  image: openjdk:11-jdk
  before_script:
    - apt-get --quiet update --yes
    - apt-get --quiet install --yes wget unzip curl
    - curl -sL https://deb.nodesource.com/setup_19.x | bash -
    - apt-get install -y nodejs
    - export ANDROID_SDK_ROOT="${PWD}/android-home"
    - install -d $ANDROID_SDK_ROOT
    - wget --output-document=$ANDROID_SDK_ROOT/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip
    - pushd $ANDROID_SDK_ROOT
    - unzip -d cmdline-tools cmdline-tools.zip
    - pushd cmdline-tools
    - mv cmdline-tools tools || true
    - popd
    - popd
    - export PATH=$PATH:${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin/
    - yes | sdkmanager --licenses || true
    - sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}"
    - sdkmanager "platform-tools"
    - sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}"
    - npm i @react-native-community/cli-platform-android
    - cd android
  script:
    - curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash
    - ls
    - ./gradlew --stop
    - ./gradlew clean assembleDebug

Problem to solve

Describe your question in as much detail as possible:

I am new to gitlab and my pipeline kept failing at

  • ./gradlew clean assembleDebug

My pipeline is running on my local runner and my SDK version is 33 but it kept showing me

Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac’.
Could not determine the dependencies of null.
Failed to install the following SDK components: build-tools;30.0.3 Android SDK Build-Tools 30.0.3

How do I fix the issue? I am new and I do not understand the issue. Hope someone can help. Thank you!

Configuration

Add the CI/CD configuration from .gitlab-ci.yml and other configuration if relevant (e.g. docker-compose.yml). Alternatively, create a public GitLab.com example project that provides all necessary files to reproduce the question.

Versions

Please select whether options apply, and add the version information.

  • Self-managed
  • GitLab.com SaaS
  • Self-hosted Runners

Versions

Thanks for taking the time to be thorough in your request, it really helps! :blush: