Android Studio : Missing Strip Tool
AndroidAndroid StudioArmStatic LibrariesAbiAndroid Problem Overview
I am constantly getting this warning while building my android studio code using terminal command gradle clean assembleRelease
:
Unable to strip library 'lib.so' due to missing strip tool for ABI 'ARMEABI'. Packaging it as is.
Please help me on how to get this warning resolved.
Note: I know this won't affect the behaviour of my app, but my APK is too bulky and this will surely help me reduce APK size. So I need this resolved.
Android Solutions
Solution 1 - Android
The default installed NDK doesn't seem to have the tools required to strip binaries that have been built with ARMEABI support, so it ends up packaging the whole library, which increases the built file size substantially.
I've found that installing the "NDK (Side by side)" tool from Android Studio -> Tools -> SDK Manager -> SDK Tools takes care of this warning and also reduces the built APK size, especially for React Native projects.
Solution 2 - Android
You can try using the following configuration in app/build.gradle.
android {
packagingOptions {
// exclude ARMEABI native so file, ARMEABI has been removed in NDK r17.
exclude "lib/armeabi/**"
}
}
>Remove (or make optional) MIPS native library #3504
Android-ABIs
Solution 3 - Android
Steps to install NDK (Side by side)
- Open
Android Studio
- Click
Configure/ Tools
- Click
SDK Manager
- Click
SDK Tools
tab- Select below:
NDK (Side by side)
CMake
Android SDK Command-line Tools (latest)
Apply
- Select below:
- Click
- Click
NOTE: Android SDK Command-line Tools (latest)
is not needed but I installed it so that I don't have to search for more solutions, today has been a lot of troubleshooting to run a new React Native app.
More info: https://developer.android.com/studio/projects/install-ndk
Solution 4 - Android
A possible solution specifically for React Native:
I got this problem when trying to build my React Native application from the command line by executing cd android/ && ./gradlew assembleDebug
(without having Android Studio open).
I opened Android Studio, I built the app there and it automatically fixed the problem. Once I tried again by command line the problem was not happening anymore.
Solution 5 - Android
I'd like to combine all the existing answers and add some more explanation/details.
First of all, just like other people mentioned, check that you have Android NDK installed (NDK (Side by side) in Android Studio -> Tools -> SDK Manager -> SDK Tools). But it's still not enough to fix this warning.
There's a list of supported ABIs by Android NDK and it has a note saying that 'armeabi' is no longer supported:
> Historically the NDK supported ARMv5 (armeabi), and 32-bit and 64-bit MIPS, but support for these ABIs was removed in NDK r17.
So, if your app needs to support ARMv5/6 devices (which is unlikely - those are pretty old), you should either:
- Use older NDK
- Ignore the warning. In this case, the library will still work on older devices even with newer NDK but will be packed in APK for every ABI, including the newer ones (which leads to increased APK size)
If there's no need in supporting ARMv5/6, you might still want to support ARMv7 ABI 'armeabi-v7a'. Once again, there are two options:
- Recompile the shared library with a newer Android NDK that supports 'armeabi-v7a' ABI
- (Not recommended) Rename 'armeabi' folder to 'armeabi-v7a' (I'm not sure whether libraries for these ABIs are compatible or not)
If the library doesn't belong to you, you should probably ask its maintainer to fix it.
But if there's no need in supporting even ARMv7, feel free just to exclude the libraries:
android {
packagingOptions {
exclude "lib/armeabi/**"
}
}