Search code examples
androidandroid-ndkadbnative

I am getting INSTALL_FAILED_CPU_ABI_INCOMPATIBLE while trying to run android project with native code


trying to run an android app. with native code in it. And I have the ndk set up . but I am getting INSTALL_FAILED_CPU_ABI_INCOMPATIBLE as error in console while running it on my device.

can any1 help me with this?

thanks in advance


Solution

  • The Galaxy Y has an ARMv6-based CPU, which means you should compile your code with at least 'APP_ABI := armeabi', which is normally the default.

    Many recent devices have an ARMv7-based CPU, which runs 'armeabi' and 'armeabi-v7a' binaries, the later run much more efficiently on these devices, but they will not on the Galaxy Y.

    It is likely you're using a prebuilt native shared library (e.g. libfoo.so) that was built for 'armeabi-v7a', and the system is complaining that the device cannot run them.

    Try rebuilding the library with "APP_ABI := armeabi", you will find more information about this under $NDK/docs/CPU-ARCH-ABIS.html and $NDK/docs/APPLICATION-MK.html.