Android ndk installation and configuration on circleci

android
circle.yml

#1

I am getting the message NDK not configured and the build is failing. I have tried setting the environment variable $ANDROID_NDK, but no luck. Here is my circle.yml file. I am a novice, please help me to figure out the issue

general:
artifacts:

  • /home/ubuntu/ECGApplication/app/build/outputs/apk/

machine:
environment:
ANDROID_HOME: /usr/local/android-sdk-linux
ANDROID_NDK_HOME: ${ANDROID_NDK}

dependencies:
pre:

  • ( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | android update sdk --no-ui --all --filter “tools,platform-tools,android-23,extra-google-m2repository,extra-android-m2repository,extra-android-support”
  • echo y | android update sdk --no-ui --all --filter “build-tools-23.0.2”

test:
override:

  • (./gradlew assemble):
    timeout: 360

Please define ANDROID_NDK_HOME
#2

Try adding “android.useDeprecatedNdk=true” to your gradle.properties file. In my case, create a gradle.properties file and add that value to it. My app structure is less standard than most, so I had to create the file with only that value and place it the parent directory of the project.


#3

I have already added android.useDeprecatedNdk=true in my gradle.properties file


#4

I have changed the OS to Ubuntu 12.04 (Precise) and its working now!!!
Was using Ubuntu 14.04 (Trusty)


#5

it seems that in past docker releases circle used install_sdk function (bash) to install both ndk and sdk.
in 14.04 the scripts were split into install_sdk and install_ndk, they don’t call install ndk by default at least for now hence ndk is not installed by default on ubuntu 14.04 docker containers.

you can use in - install_ndk in your circle.yml file but i’m pretty sure the directory is not cached (it’s not part of the docer) and it will extend the build time a lot!


#6

Please add NDK installation by default in ubuntu 14.04


#7