Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

ERROR: Cannot find 'make' program. Please install Cygwin make package

Oleh Ponomarenko September 3, 2019

Can't build an Android project. Have the error:
"Cannot find 'make' program. Please install Cygwin make package"

I use ndk in my project.
My config: 

# This is a sample build configuration for Java (Gradle).
# Check our guides at https://confluence.atlassian.com/x/zd-5Mw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: java:8

pipelines:
default:
- step:
caches:
- gradle
- android-sdk

script:
# Download and unzip android sdk
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
- unzip -o -qq android-sdk.zip -d android-sdk

# Define Android Home and add PATHs
- export ANDROID_HOME="/opt/atlassian/pipelines/agent/build/android-sdk"
- export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"
- export ANDROID_NDK_HOME="$ANDROID_HOME/ndk-bundle"
- export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_NDK_HOME:$PATH"


# Download packages.
- yes | sdkmanager "platform-tools"
- yes | sdkmanager "platforms;android-27"
- yes | sdkmanager "build-tools;27.0.3"
- yes | sdkmanager "extras;android;m2repository"
- yes | sdkmanager "extras;google;m2repository"
- yes | sdkmanager "extras;google;instantapps"
- yes | sdkmanager "ndk-bundle"
- yes | sdkmanager --licenses

# Build apk
- chmod a+x ./gradlew
- ./gradlew assembleDebug

definitions:
caches:
android-sdk: android-sdk

 

2 answers

0 votes
inger_klekacz April 6, 2021

I was having this issue and it's obnoxious. It seems that ndk-build can't find the `make` executable that comes installed in the ndk-bundle package.

So you'll need to tell it where it is by setting the GNUMAKE variable.  I ended up firing up this image in a docker container and running a UNIX `find` command to figure out where ndk-bundle's `make` was.

I wrote it up in my Github.io site: https://ingernet.github.io/bitbucket/cicd/android/docker/2021/04/07/cicd-bitbucket-android.html

Hope this helps!

0 votes
mkleint
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2019

It's unclear what expects the make tool to be present and what should install it and how.

 

To debug the problem, try running the base image via docker interactively on your local machine and reproduce all the steps from pipeline.

```docker run --rm --entrypoint /bin/sh -ti java:8```

 

Alternatively there appear to be docker images with android sdk, like https://github.com/thyrlian/AndroidSDK that could do the job as well. (I haven't done any android development myself so no idea if that fits your usecase).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events