What does this mean: Failure [INSTALL_FAILED_CONTAINER_ERROR]?

AndroidPackage ManagersAndroid Package-Managers

Android Problem Overview


I try to deploy my app and sometimes get this error:

Failure 
[INSTALL_FAILED_CONTAINER_ERROR] 

I tried to google it but don't find what the error means or what it's caused by. I deploy via IDE (IntelliJ) the file gets copied to the device to the /data/local/tmp (unrooted Huawei Ideos, running 2.2), but the package manager doesn't seem to like it. Before installing the apk, I already removed the app from the device beforehand. I also made sure there was no old file under /data/local/tmp on the device. Still I'm getting this error now. The package should be signed with the debug key, since I deploy via IDE by 'running' the app.

$ pwd 
/data/local/tmp 
$ ls -l 
-rw-rw-rw- shell    shell    17257686 2011-04-21 20:31 
com.company.shop 
$ pm install -r com.company.shop 
        pkg: com.company.shop 
Failure [INSTALL_FAILED_CONTAINER_ERROR]

What does it mean and how to resolve it?

Edit/Update:

I can avoid the error when not allowing the app to be installed on sdcard, setting

android:installLocation="internalOnly"

in the manifest. It's ok for development, but for production, it's not really what I want - since my app is quite large with 17mb; therefore I prefer it to be on sdcard. How to ever be able to install it on the external memory without rooting (since this is the only way I could delete /mnt/secure/asec/smdl2tmp1.asec, which seems to be one solution as well).

Android Solutions


Solution 1 - Android

Change the install location from

android:installLocation="preferExternal"

into

android:installLocation="auto"

in your project's AndroidManifest.xml.

Solution 2 - Android

remove this file from your device

/mnt/secure/asec/smdl2tmp1.asec

Edit/Update by Mathias Conradt (OP):

If you don't have root access, you need to mount the sdcard and remove it via pc:

/.android_secure/smdl2tmp1.asec

Solution 3 - Android

If you're using an emulator, edit it and add more memory. I've had a problem just like this one and all I did was edit my AVD's memory from 200 MB to 1000 MB and the problem seem to go away... Good Luck.

Solution 4 - Android

This means there was an earlier installation that was corrupt. If you install on external I would suggest that you format the sd card an try again.

Solution 5 - Android

I have had this error repeatedly. I have found the simplest way to avoid the error in its entirety is to simply format the SD card. Using the phone or emulators internal tools. I have found that the automatically generated SD cards or even making your own sdcard.iso fails and causes this error unless formated by the internal android tools.

Solution 6 - Android

For me this was caused by a lack of space on my emulator's SD card. I was working with a pretty large project and I had thought 40 mb was enough, but I changed it to 200 mb and the problem went away.

Solution 7 - Android

Had the same error with various .apk on Cyanogenmod 12.1 (Android 5.1.1) on my Note 8 with a second partition for Link2SD. I was able to install the apps by forcing the installation via adb as root:

adb root
adb install -f myapp.apk

Solution 8 - Android

I got this error message from Android 5.0.1. I had changed the preferred install location to "Removable SD card" via Settings->Apps->Preferred Install Location.

I changed the option back to "Let the system decide" and the error message went away.

Solution 9 - Android

For me, it was the device language. I chnaged the language to Arabic to test my application. Then I got this error. Reverting back the language did the trick.

Solution 10 - Android

android:installLocation="auto" works..!!

If Not, Once check your external storage space size.[Available memory > app size] If storage space is not enough then also this error is thrown.

Solution 11 - Android

It happens when you don't have enough storage in internal storage to install app. Just clear up some memory in internal storage by deleting unwanted files or photos. Memory cleaning software can also help.

Solution 12 - Android

I had similar problem with emulator. It was gone when I changed emulator's CPU type from ARM to Intel.

Solution 13 - Android

in some situations, removing the libs/android-support-v4.jar generates this error.

Solution 14 - Android

For me, an uninstallation of several applications solved the problem. When a local storage has had enough memory, a deployment of APK completed successfully. But usually I simply restart a gadget, and installation completes. Also, some programs like Clean Master may help. Simply often wipe unuseful processes and close programs with Clean Master and get enough memory.

Solution 15 - Android

Restarting my device fixed the issue for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMathias ConradtView Question on Stackoverflow
Solution 1 - AndroidReneView Answer on Stackoverflow
Solution 2 - AndroidJazzView Answer on Stackoverflow
Solution 3 - AndroidDanView Answer on Stackoverflow
Solution 4 - AndroiddalbatorView Answer on Stackoverflow
Solution 5 - Androiduser2445968View Answer on Stackoverflow
Solution 6 - AndroidnoisecapellaView Answer on Stackoverflow
Solution 7 - AndroidTobi G.View Answer on Stackoverflow
Solution 8 - AndroidnyxeeView Answer on Stackoverflow
Solution 9 - AndroidElyess AboudaView Answer on Stackoverflow
Solution 10 - AndroidMallikarjungouda AnnigeriView Answer on Stackoverflow
Solution 11 - AndroidRahul KView Answer on Stackoverflow
Solution 12 - AndroidWytasView Answer on Stackoverflow
Solution 13 - AndroidAmir SaniyanView Answer on Stackoverflow
Solution 14 - AndroidCoolMindView Answer on Stackoverflow
Solution 15 - AndroidtheOzmicView Answer on Stackoverflow