Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failure [INSTALL_FAILED_CONTAINER_ERROR] when trying to install android apk package using adb for platform 4.1

Tags:

android

I generated an apk package for my android application. and I tried to install the package (apk) on android platform 4.1 (level 16) using the adb command but it genrates error:

Failure [INSTALL_FAILED_CONTAINER_ERROR]

when trying to run with eclipse (run button) for the same platform (4.1 level 16) it works without a problems

this behaviour is not reproduced for platform 2.1 and platform 3.2

like image 830
MOHAMED Avatar asked Sep 18 '12 15:09

MOHAMED


4 Answers

You need to make changes in AndroidManifest.xml. The change which you need to do is. Change :

android:installLocation="preferExternal"

to

android:installLocation="auto"

this worked for me.

like image 74
JNI_OnLoad Avatar answered Nov 12 '22 10:11

JNI_OnLoad


This will happen if android:installLocation is set to "preferExternal" and you have an AVD with a too small SD card. Increase the size of the SD card or change installLocation to auto in AndroidManifest.xml.

like image 40
emidander Avatar answered Nov 12 '22 12:11

emidander


I got this error when I deleted my app after changing the MainActivity's name. idk if the app didn't install due to space issues or the phone thought the package is corrupt but deleting the dalvik cache and rebooting solved it for me.

like image 40
user2161301 Avatar answered Nov 12 '22 11:11

user2161301


INSTALL_FAILED_CONTAINER_ERROR is also returned when trying to install an apk that contains native libraries compiled for a different architecture.

Try running "logcat" from the "adb shell" after you get the error. If it reports a java IOException "Failed to extract native code" then you need to install the apk on an avd created for the native library architecture, or include native libraries in your apk for the architecture on your avd/device.

like image 1
Felix Bellaby Avatar answered Nov 12 '22 11:11

Felix Bellaby