Please define ANDROID_NDK_HOME

android

#1

ANDROID_NDK_HOME is the canonical env variable for the ndk.dir definition, and the documented one, if only one were to be chosen.

See http://tools.android.com/build/gradleplugin

With only ANDROID_NDK defined, as is currently the case, some extra glue is needed. (The Android gradle plugin looks for a few different variables, but ANDROID_NDK is not one of them.)


#2

This seems like a very reasonable request. :slight_smile:

Just curious, if you define ANDROID_NDK_HOME as an envar manually does everything work as expected?


#3

Yes, the workaround “glue” is trivial:

ANDROID_NDK_HOME=${ANDROID_NDK}

but since ANDROID_NDK_HOME is the more canonical env variable for this purpose, I think CircleCI’s environment should pre-define it.

Our build is currently stuck because our git submodules are not being initialized (see Feature Request) and I’m such a novice that I don’t know how to workaround yet.


#4

That makes perfect sense, thank you for letting us know. I will see what we can do about this.


#5

Thanks.

The build works now, after defining this variable and adding a pre-dependency command to update the git submodules.


#6

I’d like to see this small improvement achieved.

Are feature requests handled only on this discuss list, or is there some place where they can be created and tracked? I’m new to CircleCI and want to make sure I’m providing feedback correctly.


#7

This is the best place to add feature requests, if we decide to implement them we will provide updates to their status here.


#8

wow, really odd that it didn’t implemented yet ;-(


#9

@kimh is this something that we can do at the image level?


#10

It doesnt work for me. Here is my circle.yml file. I am still getting the message NDK not configured and the build is failing.

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`


#11

@gdsomia As was resolved elsewhere (android-ndk-installation-and-configuration-on-circleci), this problem was not with (missing) ANDROID_NDK_HOME assignment, but with missing ndk installation on Ubuntu 14.04.


#12

What is the status on this? I don’t understand this is still not implemented given this environment variable is now the standard to define the NDK path.


#13