Amira Elsayed Ismail
Amira Elsayed Ismail

Reputation: 9414

transformNativeLibsWithStripDebugSymbolForRelease execution failed with mips64el-linux-android-strip

I am getting this error in android studio, please anyone know how to solve it let me know

Execution failed for task ':q84sale-base:transformNativeLibsWithStripDebugSymbolForRelease'.
> A problem occurred starting process 'command '/Users/amira/Library/Android/sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/darwin-x86_64/bin/mips64el-linux-android-strip''

Upvotes: 8

Views: 14433

Answers (3)

dt170
dt170

Reputation: 455

For me it was to download older ndk version 20.0.5594570 then in local.properties set those.

sdk.dir=/Users/YOUR USER/Library/Android/sdk
ndk.dir=/Users/YOUR USER/Library/Android/sdk/ndk/20.0.5594570

make sure to replace YOUR USER with your path.

worked for me on mac

Upvotes: 0

Opeyemi Lawal
Opeyemi Lawal

Reputation: 135

I had the same issue when trying to open an old project, I solved the problem by deleting the ndk folder in the Android SDK path Android/sdk/ndk. Then run the project successfully.

Upvotes: 0

shizhen
shizhen

Reputation: 12583

Reasons:

According to https://github.com/android-ndk/ndk/wiki/Changelog-r18#known-issues

This version of the NDK is incompatible with the Android Gradle plugin version 3.0 or older. If you see an error like No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android, update your project file to use plugin version 3.1 or newer. You will also need to upgrade to Android Studio 3.1 or newer.


As said above:

update your project file to use plugin version 3.1 or newer. You will also need to upgrade to Android Studio 3.1 or newer.

The Direct solution is:

From your TOP-LEVEL build.gradle, change your classpath for android gradle plugin to 3.2.1 or higher.

classpath 'com.android.tools.build:gradle:3.2.1'

But, if you want to stick to your existing Gradle plugin version, the workarounds/solutions are as below:

Option 1:

There is no more mips architecture since ndk-17. So, you can either downgrade your NDK (for older versions of NDK, please check from here: https://developer.android.com/ndk/downloads/older_releases) or add abiFilters to exclude mips ABIs.

Seeing that your are using ndk-bundle which is the default ndk path settings of Android Studio. You can configure this path from local.properties making it point at your NDK version, e.g. r16b, rather than the default ndk-bundle.

ndk.dir=<path>/android-ndk-r16b
sdk.dir=<path>/sdk

Option 2:

Using below configuration to only filter the necessary ABIs.

android {
    // Similar to other properties in the defaultConfig block, you can override
    // these properties for each product flavor in your build configuration.
    defaultConfig {
        ndk {
            // Tells Gradle to build outputs for the following ABIs and package
            // them into your APK.
            abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
        }
    }
}

Or if you are using cmake

buildTypes {
    debug {
        externalNativeBuild {
            cmake {
                abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
            }
        }
    }
    release {
        externalNativeBuild {
            cmake {
                abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
            }
        }
    }
}

Option 3:

Another workaround is to skip the stripping of mips using below configuration:

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

Choose the best option for your case.

Upvotes: 16

Related Questions