Wednesday, April 25, 2012

How to resolve the "INSTALL_FAILED_CONTAINER_ERROR" in Android?


By Default, All Android applications can be installed in internal memory or external memory (SDCARD).
If you specify android:installLocation="preferExternal" in your AndroidManifest.xml file, then the application will be installed on external storage.

If you declare "preferExternal", you request that your application be installed on the external storage, but the system does not guarantee that your application will be installed on the external storage.
If the external storage is full, the system will install it on the internal storage. The user can also move your application between the two locations.

The kernel has to support the installations of the applications on the external memory.
Without the kernel support the application installation will end up in the error message " INSTALL_FAILED_CONTAINER_ERROR "

Enable these configurations in linux kernel and build the kernel

CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
CONFIG_MD_MULTIPATH=y
CONFIG_BLK_DEV_DM=y
CONFIG_DM_DEBUG=y
CONFIG_DM_CRYPT=y
CONFIG_DM_SNAPSHOT=y
CONFIG_DM_MIRROR=y
CONFIG_DM_LOG_USERSPACE=y
CONFIG_DM_ZERO=y
CONFIG_DM_MULTIPATH=y
CONFIG_DM_MULTIPATH_QL=y
CONFIG_DM_MULTIPATH_ST=y
CONFIG_DM_UEVENT=y
CONFIG_CRYPTO_GF128MUL=y
CONFIG_CRYPTO_XTS=y
CONFIG_CRYPTO_SHA512=y
CONFIG_CRYPTO_WP512=y
CONFIG_CRYPTO_BLOWFISH=y
CONFIG_CRYPTO_TWOFISH=y
CONFIG_CRYPTO_TWOFISH_COMMON=y
CONFIG_CRYPTO_USER_API=y
CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_USER_API_SKCIPHER=y
CONFIG_CRYPTO_DEV_OMAP_AES=y


After these changes you can install all the applications on your device either as a part of internal or external memory