unable to strip library packaging it as is

app编译时候失败提示:

:app:transformNativeLibsWithStripDebugSymbolFor_360Debug
Unable to strip library '……\app\build\intermediates\transforms\mergeJniLibs\_360\debug\folders\2000\1f\main\lib\armeabi\libsgmain.so', packaging it as is.
:app:transformNativeLibsWithStripDebugSymbolFor_360Debug FAILED

`FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformNativeLibsWithStripDebugSymbolFor_360Debug'.
> A problem occurred starting process 'command 'C:\android\sdk\ndk-bundle\toolchains\mips64el-linux-android-4.9\prebuilt\windows-x86_64\bin\mips64el-linux-android-strip''

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 56s`

一直在google搜索unable to strip library packaging it as is苦苦无果,最终在stackoverflow找到原因以及解决办法:

原因:

NDK版本是17

解决办法:

1. Remove everything from directory [android-sdk]\ndk-bundle\ or uninstall Android NDK in Android Studio\Sdk tools (see on the image above)

2. Close Android Studio (AS).

3. Download (in my case) NDK version 16b from https://developer.android.com/ndk/downloads/older_releases

4. Extract archive (10 directories and 8 files or so) to [android-sdk]\ndk-bundle\

5. Start AS and perform full refresh: Build Refresh Linked C++ projects and Build Rebuild project.

  1. 如果发现还是报这个错,重启电脑就好了,别问我为什么知道,我就是这样

参考:

unable to strip library packaging it as is