Android NDK build for Pipelines

Hi,

I tried to use Pipelines for my project. The problem is that I use ndk in my project. I found pipelines configuration file for Android which looks like this:

image: uber/android-build-environment:latest

pipelines:
  default:
    - step:
        script:
          - ./build.sh

where build.sh looks like:

mkdir "${ANDROID_HOME}/licenses" || true
echo "8933bad161af4178b1185d1a37fbf41ea5269c55" > "${ANDROID_HOME}/licenses/android-sdk-license"

./gradlew assembleDebug

But I've got following error:

<filename>.cpp:1:17: fatal error: jni.h: No such file or directory
compilation terminated.
make: *** [/opt/atlassian/pipelines/agent/build/app/build/intermediates/ndk/dev/debug/obj/local/armeabi-v7a/objs/<project name>//opt/atlassian/pipelines/agent/build/app/src/main/jni/<filename>.o] Error 1
:app:compileDevDebugNdk FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDevDebugNdk'.
> com.android.ide.common.process.ProcessException: Error while executing '/usr/local/android-ndk/ndk-build' with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/opt/atlassian/pipelines/agent/build/app/build/intermediates/ndk/dev/debug/Android.mk APP_PLATFORM=android-25 NDK_OUT=/opt/atlassian/pipelines/agent/build/app/build/intermediates/ndk/dev/debug/obj NDK_LIBS_OUT=/opt/atlassian/pipelines/agent/build/app/build/intermediates/ndk/dev/debug/lib APP_ABI=armeabi-v7a,armeabi,mips,x86}
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED

What should I change in my configuration to make it work.

 

Thanks

0 answers

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

627 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot