What is Does This Mean?
The INSTALL_FAILED_CPU_ABI_INCOMPATIBLE error is generated when you attempt to install an android application on a device with an unsupported CPU architecture. This error is usually related to the native libraries that are not packaged up for the device’s CPU architecture (ie: x86, ARMv6, ARMv7, etc).
Now, if you have an application that doesn’t use any native libraries or *.so file you might be scratching your head on this one. If you use IntelliJ IDEA IDE for your android development it might be packaging all of your related .JAR file in to the Native Library file location in your APK.
So You Use IntelliJ and You Get the INSTALL_FAILED_CPU_ABI_INCOMPATIBLE Error
I will be honest, a StackOverflow article helped me resolve this issue. For those experiencing the same issue I just want to give a clear tutorial why and how to resolve this issue.
For some reason when you import or create a IntelliJ project the project settings automatically sets a Native library location. This location usually corresponds to the same popular folder name used to store JAR libraries.
If you get the
Failure [INSTALL_FAILED_CPU_ABI_INCOMPATIBLE] when building/running an android application using IntelliJ this is how you resolve it:
- Once your application open Click File menu Item –> Click Project Structure
- Ensure Modules is selected in the left side menu –> Expand all projects to expose the Android Facet.
- Click on each android facet underneath each project to bring up the project detail
- Ensure the Structure tab is selected and you should see settings for the Manifest file, Resources Directory, Assets Directory and Native libs directory.
- Make sure the Native libs directory textbox setting is blank/cleared.
Now if you have native library you probably don’t want to clear this settings. You will want to keep your JARs separate from your native libraries in their own folders specifying the native folder in the settings.