70

I updated to Android studio 2.3 and my project got these errors

Error:org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:\Users\...\AppData\Local\Android\sdk\ndk-bundle\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\bin\aarch64-linux-android-strip''


Error:net.rubygrapefruit.platform.NativeException: Could not start 'C:\Users\...\AppData\Local\Android\sdk\ndk-bundle\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\bin\aarch64-linux-android-strip'


Error:java.io.IOException: Cannot run program "C:\Users\...\AppData\Local\Android\sdk\ndk-bundle\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\bin\aarch64-linux-android-strip" (in directory "E:\projectNmame\app"): CreateProcess error=2, The system cannot find the file specified

Can anyone help me to fix this? I'm stuck on this issue.

1
  • 2
    I ran into this error on Bitrise and I solved it by changing the stack to Android without the NDK. The stack config was is quay.io/bitriseio/android. Hope that helps somebody! Commented May 19, 2018 at 4:04

11 Answers 11

97

I have Android Studio 3.1.2 and after I approved the IDE suggested updates I got the next errors:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task '...'.

Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/Users/.../Library/Android/sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/darwin-x86_64/bin/mips64el-linux-android-strip'

Caused by: net.rubygrapefruit.platform.NativeException: Could not start '/Users/.../Library/Android/sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/darwin-x86_64/bin/mips64el-linux-android-strip'

Caused by: java.io.IOException: Cannot run program "/Users/.../Library/Android/sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/darwin-x86_64/bin/mips64el-linux-android-strip" (in directory "/Users/.../.../.../app"): error=2, No such file or directory

Caused by: java.io.IOException: error=2, No such file or directory

It looks like there is a problem with NDK version 17.0.4754217.

Since I don't use ndk components in my project for me the solution was removing NDK from the SDK Manager.

Go to SDK Manager -> SDK Tools tab -> uncheck NDK -> Apply.

enter image description here

2
  • 1
    Helped me to build and run the project with OpenCV lib integrated (before the update to Android Studio 3.1.2 it works without problems), but it is a temporary workaround. This issue might somehow connected to the mips, mips64, armeabi deprecation in NDK r17: developer.android.com/ndk/guides/abis#sa
    – yaroslav
    Commented May 14, 2018 at 8:33
  • 1
    This worked for me, but god forbid I have to actually build native code after this. How does Google screw this kind of thing up so often? "Stable release", whatever. Commented May 17, 2018 at 17:41
97

I had the same problem when using NDK version 17.0.4754217 (maybe on newer versions, it doesn't happen). You can workaround this issue by adding the following code in your gradle.build:

packagingOptions{
    doNotStrip '*/mips/*.so'
}

Or

packagingOptions{
    doNotStrip '*/mips/*.so'
    doNotStrip '*/mips64/*.so'
}

If you are using native code (C++), I recommend add the following code too:

ndk {
    abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86' // <- only the supported ones
}

To make sure you won't embed any MIPS binary.

3
  • Thanks a lot Buddy :)
    – Hanry
    Commented May 29, 2018 at 7:01
  • 1
    This is not the same problem, but similar. You were missing MIPS binaries (intentionally dropped at r17, see e.g. github.com/android-ndk/ndk/issues/700), not ARM64, as reported by the OP.
    – Alex Cohn
    Commented May 30, 2018 at 9:38
  • 3
    Small correction - It should be added under the android closure and not just anywhere in the build.gradle
    – brkeyal
    Commented Jun 14, 2018 at 15:24
21

Add these to gradle.build file:

packagingOptions{
    doNotStrip '*/mips/*.so'
    doNotStrip '*/mips64/*.so'
}
1
  • Today I had this problem. This simple solution just solved my problem.
    – HendraWD
    Commented May 28, 2018 at 10:47
16

Yes, I got this error after update NDK to 17.0.4754217.

I just tried workaround solutions with copy folder from v.16 (\android-ndk-r16b-windows-x86_64\android-ndk-r16b\toolchains\mips64el-linux-android-4.9\prebuilt\windows-x86_64) from https://developer.android.com/ndk/downloads/older_releases and it work for me.

Not sure about stable but it work for me, until waiting new fix from Google.

2
15

I found a package here from which I copied all missing files and now it's working perfect.

1
  • 2
    folder \toolchains\mips64el-linux-android-4.9\prebuilt\windows-x86_64 contains only 1 file. I copied files from r16b Commented May 31, 2018 at 14:20
15

I had to download about 1 GB file just to get these small packages so anybody having an issue with these packages can download them from the link below and then simply extract them to

sdk\ndk-bundle\toolchains\

mips64el-linus-android

aarch64-linux-android

1
  • Thanks. But this is for Windows. Do you have it for Mac?
    – Myth
    Commented Sep 25, 2018 at 12:21
2

I had solved this problem by change the NDK version to a older one. You can get a older version of ndk from https://developer.android.com/ndk/downloads/older_releases . The NDK's path is defined in the file named local.properties in the android project. Empty the original NDK file then decompress the oloder version NDK archive to the path defined in local.properties. Finally clean and rebuild the project.

1

The main reason is as above everyone explained, removal of support from r17. Simple and quick solution is.

  1. Download NDK release r16 from [https://developer.android.com/ndk/downloads/older_releases][1]
  2. Extract it
  3. Copy files under toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/ from r16 extracted folder
  4. Paste the compied files to your ndk directory (r17) toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/ folder

This worked for me.

0

I faced this issue while I was building on jenkins slave.

I had deleted the NDK on the development computer which could successfully build and then I couldn't build successfully anymore.

So I used the android studio to open the project on jenkins slave

download ndk by sdk manager as picture

After the download finished my project can build successfully.

Hope this helps

0

I also faced the same issue when I have installed the 25.2.9519653 version of NDK. For me the simple solution that worked was to upgrade the Gradle version to latest version.

Hope this helps...!!

-3

The very helpful tip for this is to download

> android-ndk-r16b

Then simply change the NDK path to android-ndk-r16b

LIKE ME:

C:\Android\android-ndk-r16b

Then definitely this wills shutout my first app experience.

Image shown here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.