[Android] Build failed in GradleRunner step with NDK error (not used)

Bitrise Build Issue Report template

Description of the issue

Build for Release (classic signed APK) on my Android projects does not work anymore since May. There is an error in step Gradle-Runner (up to date) : :app:transformNativeLibsWithStripDebugSymbolForProdRelease FAILED

Environment:

Where did the issue happen?

Stack: Android & Docker on Ubuntu 16.04

Which build Step causes the issue and which version of the step?

gradle-runner@1.8.3 (exit code: 1)

Reproducibility

  • Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build) : NO
  • Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. : NO
  • Does the issue happen sporadically, or every time? : EVERY TIME
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? : Detected today (May 14th). Was working until end of april.

Local reproduction

Can it be reproduced on your own Mac/PC by following our local debug guide? Please follow at least the first section (“Testing with a full clean git clone”) to make sure to test the state of the code what bitrise.io will get when it does a git clone in the clean environment! If possible please note which sections you tried.

Local reproduction: Linux / Android (docker based) stack builds

Can it be reproduced by running the build locally, after doing a new git clone of the repository into the /tmp directory and running the build from there with the Bitrise CLI ( Bitrise CLI )? If no, can it be reproduced with Docker (using the same docker images / environment we use on bitrise.io)? Related guide: Redirecting… .

Build log

1 Like

is there any solution to solve this problem?
because facing same issue.

I have same issue. An identical configuration worked on May 9th. Does somebody have a workaround because this blocks my work.

One of the solutions is to update Android Gradle plugin version. At least 'com.android.tools.build:gradle:3.1.2' works.

after upgrading its working for you?

Yes, it works. At least for errors involving missing armeabi and mips toolchains.

yup i tried but still facing same error
Execution failed for task ‘:presentation:transformNativeLibsWithStripDebugSymbolForEdCastAppDebug’.

A problem occurred starting process ‘command ‘/opt/android-ndk/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/bin/mips64el-linux-android-strip’’

1 Like

Hard to say more for me since I have no access to logs.
After upgrading I’ve got this note instead of error:
Unable to strip library '/bitrise/src/app/build/intermediates/transforms/mergeJniLibs/<stripped>/<stripped>/0/lib/mips64/lib<stripped>.so' due to missing strip tool for ABI 'MIPS64'. Packaging it as is.
Task does not fail on mips library but just keeps it untouched.

Issue seems to be related to the Android NDK version upgrade which we rolled out this weekend (from r16b to r17):

Related system report changelog : https://github.com/bitrise-io/bitrise.io/pull/212/commits/4331f07ccf77d7e57bfce67c269687100a7458a3

Quick question @itelios.team-mobile - did you upgrade the Android NDK on your own Mac/PC to r17?
If you’re not using r17 yet or if you want to use a specific NDK version the best is to just install it via a Script step:

If NDK is not used at all (as I guess from the title suffix “(not used)”) even unsetting ANDROID_NDK_HOME (or setting it to empty string) should do the trick.

2 Likes

We have not indeed updated the NDK as we don’t use it for our apps.

And thank you very much for the solution, it is now resolved!

1 Like

Hi, I am getting the same error

A problem occurred starting process ‘command ‘/opt/android-ndk/toolchains/mipsel-linux-android-4.9/prebuilt/linux-x86_64/bin/mipsel-linux-android-strip’’

I am running on same stack Android & Docker on Ubuntu 16.04 & gradle runner 1.5.2

Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process ‘command ‘/opt/android-ndk/toolchains/mipsel-linux-android-4.9/prebuilt/linux-x86_64/bin/mipsel-linux-android-strip’’
at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:197)
at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:327)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:86)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: net.rubygrapefruit.platform.NativeException: Could not start ‘/opt/android-ndk/toolchains/mipsel-linux-android-4.9/prebuilt/linux-x86_64/bin/mipsel-linux-android-strip’
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:68)
… 2 more
Caused by: java.io.IOException: Cannot run program “/opt/android-ndk/toolchains/mipsel-linux-android-4.9/prebuilt/linux-x86_64/bin/mipsel-linux-android-strip” (in directory “/bitrise/src/app”): error=2, No such file or directory
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
… 4 more
Caused by: java.io.IOException: error=2, No such file or directory

Thanks for this. We were also not using the NDK, so I modified the step where gradle is run (in our case a Script) to:

#!/bin/bash

unset ANDROID_NDK_HOME
cd android 
./gradlew clean assembleRelease

And now our (React Native) app builds again. Awesome!

2 Likes

We were having the same issue - we don’t use the NDK and now our previously working build not longer builds…

Easy fix seems to be to set ANDROID_NDK_HOME to nothing in the “$ ENV Vars” tab for your bitrise workflow

2 Likes

Note: Official Android NDK changelog: https://github.com/android-ndk/ndk/wiki/Changelog-r17

Support for ARMv5 (armeabi), MIPS, and MIPS64 has been removed. Attempting to build any of these ABIs will result in an error.

Another interesting deprecation note:

Support for ICS (android-14 and android-15) will be removed from r18.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.