由于mips64el-linux-android-strip,transformNativeLibsWithStripDebugSymbolForRelease执行失败 [英] transformNativeLibsWithStripDebugSymbolForRelease execution failed with mips64el-linux-android-strip

查看:273
本文介绍了由于mips64el-linux-android-strip,transformNativeLibsWithStripDebugSymbolForRelease执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在android studio中遇到此错误,请任何人知道如何解决它

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''

推荐答案

原因:

根据 https://github.com/android- ndk/ndk/wiki/Changelog-r18#known-issues

此NDK版本与Android Gradle插件版本3.0或更旧版本不兼容.如果看到类似No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android的错误,请更新项目文件以使用3.1或更高版本的插件.您还需要升级到Android Studio 3.1或更高版本.

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:

更新您的项目文件以使用3.1或更高版本的插件.您还需要升级到Android Studio 3.1或更高版本.

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.

直接解决方案是:

在您的TOP-LEVEL build.gradle中,将Android gradle插件的类路径更改为3.2.1或更高版本.

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'


但是,如果您要坚持使用现有的Gradle插件版本,则解决方法/解决方案如下:


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

选项1:

ndk-17起,不再有mips体系结构.因此,您可以降级NDK(对于较早版本的NDK,请从此处进行检查: https://developer.android.com/ndk/downloads/older_releases )或添加abiFilters以排除mips ABI.

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.

看到您正在使用 ndk-bundle (这是Android Studio的默认ndk路径设置).您可以从 local.properties 配置此路径,使其指向您的NDK版本,例如 r16b ,而不是默认的ndk-bundle.

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

选项2:

使用以下配置仅过滤必要的ABI.

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'
        }
    }
}

或者如果您使用的是cmake

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

选项3:

另一种解决方法是使用以下配置跳过对mips的剥离:

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.

这篇关于由于mips64el-linux-android-strip,transformNativeLibsWithStripDebugSymbolForRelease执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆