I'm encountering an issue with my Bitbucket pipeline while building my Android project. The error message I receive is:
Execution failed for task ':core_data:configureCMakeRelWithDebInfo[arm64-v8a]'.
[CXX1416] Could not find Ninja on PATH or in SDK CMake bin folders.
My project has some C++ code, and the build completes successfully locally on Android Studio. However, I am unsure how to properly install Ninja or CMake in the Bitbucket pipeline environment and configure the PATH variables accordingly. Any guidance on setting up Ninja and CMake correctly in the pipeline would be greatly appreciated.
bitbucket-pipeline.yml
image: mingc/android-build-box:latest
pipelines:
default:
- parallel:
- step:
size: 2x
name: KtLint
caches:
- gradle
- gradle-wrapper
script:
- chmod +x gradlew
- ./gradlew ktlintCheck
artifacts:
- app/build/reports/**
- step:
size: 2x
name: Unit-Test
caches:
- gradle
- gradle-wrapper
script:
- chmod +x gradlew
- bash ./gradlew testProductionDebugUnitTest
custom:
deployment-production-release-apk:
- variables:
- name: VERSION_CODE
- name: VERSION_GROUPS
default: "Mobile-QA,Mobile-DEV,Mobile-DESG,Mobile-BIZ,External"
- name: ADDITIONAL_NOTE
- step:
size: 2x
name: Production Release APK
clone:
depth: full
deployment: production
caches:
- gradle
script:
- if [ -z "$VERSION_CODE" ]; then export VERSION_CODE=$BITBUCKET_BUILD_NUMBER; fi
- COMMIT_MESSAGES=`git log origin/development.. --oneline --pretty=format:" • [%h] %s ~%cn"`
- COMMIT_HASH=`git rev-parse --short $BITBUCKET_COMMIT`
- DATETIME=$(date '+%D %H:%M %Z');
- export VERSION_NOTE="Branch=$BITBUCKET_BRANCH"$'\n'"Commit=$COMMIT_HASH"$'\n'"Datetime=$DATETIME"
- if [ -n "$ADDITIONAL_NOTE" ]; then export VERSION_NOTE="$VERSION_NOTE"$'\n'"Note=$ADDITIONAL_NOTE"; fi
- if [ -n "$COMMIT_MESSAGES" ]; then export VERSION_NOTE="$VERSION_NOTE"$'\n\n'"Commit History"$'\n'"${COMMIT_MESSAGES::15500}"; fi
- echo $VERSION_NOTE
# Setup licenses
- mkdir "${ANDROID_HOME}/licenses" || true
# Give execution access to gradle
- chmod +x gradlew
########## ASSEMBLE AND UPLOAD TO FIREBASE ##########
# Firebase App Distribution requires FIREBASE_TOKEN environment variable
- bash ./gradlew assembleProductionRelease appDistributionUploadProductionRelease
definitions:
caches:
gradle-wrapper: ~/.gradle/wrapper
i tried the following statement but did not work, still getting the same error msg
sudo apt-get update && sudo apt-get install -y ninja-build