16

Can anyone tell me why I am receiving this error? I have downloaded a series of projects from GitHub for a Udacity course. Since there are about 50 or 60 projects (Exercises and Solutions) in the repo, I presume it has to do with the fact that each is an individual project on its own. I do not have a problem usually when I fork a repo and clone it locally.

I have read other posts about uninstalling and reinstalling ndk in the sdk. But I really want to know why this is happening and how I can fix without blindly uninstalling and re-installing. Any help is appreciated. Thanks.

C0D3JUNKIE
  • 596
  • 1
  • 6
  • 16
  • Looks like this is a duplicate. Check the first answer about mips being removed. That is the correct explanation it looks like. – C0D3JUNKIE Oct 17 '18 at 16:15
  • Check this thread of [**three options** for solving this kind of issue](https://stackoverflow.com/a/51852529/8034839) – shizhen Feb 01 '19 at 05:02

7 Answers7

27

After looking around, the solution was to remove the NDK designation from my preferences.

Android Studio → Preferences → System Settings → Android SDK → SDK Tools → Unselect NDK → Apply button.

Project and Gradle compiled fine after that and I was able to move on with my project work.

As far as why this is happening, I do not know but for more info on NDK check out: https://developer.android.com/ndk/

I will go back and enable these libraries but for now.

double-beep
  • 5,031
  • 17
  • 33
  • 41
C0D3JUNKIE
  • 596
  • 1
  • 6
  • 16
  • 1
    For android studio v3.2.1: Android Studio -> File -> Settings -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools -> Unselect NDK -> Apply button. – dtytomi Jan 09 '19 at 13:03
  • 1
    Check more answers from this thread: https://stackoverflow.com/questions/51850591/transformnativelibswithstripdebugsymbolforrelease-execution-failed-with-mips64el/51852529#51852529 – shizhen Feb 01 '19 at 02:14
23

If you are using NDK >= 18 you have to update your android gradle plugin to >=3.1.x

See the Known Issues section:

https://android.googlesource.com/platform/ndk/+/ndk-release-r18/CHANGELOG.md

Thomas S.
  • 231
  • 1
  • 5
  • 1
    I think what was happening is that since the project was so big it was not getting to the update Gradle prompt as it normally does. So I would update manually and then re-sync or reopen the project. Thanks again for the information that would explain it. – C0D3JUNKIE Sep 19 '18 at 14:47
11

for me, upgrade the Android Gradle plugin version to 3.2+ works.

  classpath 'com.android.tools.build:gradle:3.2.0'
Aanal Shah
  • 273
  • 1
  • 2
  • 14
10

Android Studio -> Preferences -> System Settings -> Android SDK -> SDK Tools -> Unselect NDK -> Apply button.

It works fine for me.

HusseinKamal
  • 121
  • 1
  • 5
7

Updating the Android Gradle plugin is definitely the preferred solution. However, if for whatever reason you can't do that, it's easy to simply "fix" the error without downloading, copying, or symlinking anything, by just creating an empty directory:

mkdir -p $ANDROID_HOME/ndk-bundle/toolchains/mips64el-linux-android/prebuilt/linux-x86_64

$ANDROID_HOME points to the root of the Android SDK installation. On MacOS, replace linux-x86_64 with darwin-x86_64. Use windows-x86_64 on Windows.

friederbluemle
  • 33,549
  • 14
  • 108
  • 109
3

It's Because of NDK Version You are selected Follow the steps which will help you to resolve

If you want to use NDK then Update the Gradle Plugin

In build script change Dependecies

classpath { 'com.android.tools.build:gradle:3.2.1'
classpath {'com.google.gms:google-services:3.2.0'}

if you are unaware of the NDK then simply disable it by selecting preferences>System settings>android sdk>Select SDK Tools > uncheck NDK there

Rebuild the project it works just fine

Happy Coding <3

1

If you don't want to update your gradle plugin you can do this. Download one of the older NDK releases, e.g. r17c. Open downloaded NDK archive, go to toolchains directory and copy missing toolchain folders to toolchains folder of your currently used NDK. In my case the folders I had to copy were mipsel-linux-android-4.9 and mips64el-linux-android-4.9.

Egis
  • 5,081
  • 5
  • 39
  • 61