22

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

MOHAMED
  • 41,599
  • 58
  • 163
  • 268
  • possible duplicate of [What does this mean: Failure \[INSTALL_FAILED_CONTAINER_ERROR\]?](http://stackoverflow.com/questions/5744298/what-does-this-mean-failure-install-failed-container-error) – mah Sep 18 '12 at 16:18

8 Answers8

82

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.

emidander
  • 2,383
  • 22
  • 29
JNI_OnLoad
  • 5,472
  • 4
  • 35
  • 60
15

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.

emidander
  • 2,383
  • 22
  • 29
7

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.

user2161301
  • 674
  • 9
  • 22
1

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.

1

My issue got solved by wiping the emulator data

JoelSebstn
  • 522
  • 4
  • 5
0

I wasnt able to change manifest of the build, so for me was the solution unmount SD card, install app and then mount it back.

user3098756
  • 340
  • 4
  • 10
0

i change installLocation="auto" in manifest but not work. I found problem in something wrong with my sdcard.

So, i change android:installLocation="preferExternal to internalOnly. It work for me!

Linh Van
  • 1
  • 1
0

If you're testing your app on an emulator, I'd recommend wiping the emulator's data and starting it again:

1 - In Android Studio, navigate to the AVD Manager (Tools -> AVD Manager).

2 - Next to the emulator in question, click the drop-down menu on the Actions column.

3 - Click "Wipe Data" and "Cold Boot Now".

Remember to always keep your tools up to date, including Android Studio, Android SDK, and Expo CLI, as this might resolve the issue as well.