What does this mean: Failure [INSTALL_FAILED_CONTAINER_ERROR]?
Asked Answered
G

15

130

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).

Granese answered 21/4, 2011 at 12:46 Comment(3)
Just out of curiosity: can you install it by pm install -f com.company.shop ?Cantara
There are several variations on the INSTALL_FAILED_CONTAINER_ERROR problem, for some of them see my answer here: https://mcmap.net/q/175276/-error-creating-imagefile-read-only-file-systemCeil
For me, it was as simple as the emulator "running out of space" (???) and i had to Wipe Data in the AVD Manager.Scorbutic
I
45

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
Idette answered 21/4, 2011 at 12:55 Comment(8)
but my device is unrooted, and looking at the secure folder, only root has access. I was able to run the app before, only now since a while, cannot run it and it gives the above error.Granese
btw - there's also a folder /mnt/asec/ that I can reach with non-root, but that's emptyGranese
Ok, turns out I need to mount the sdcard and remove it via pc (.android_secure/smdl2tmp1.asec), then it works again.Granese
@Idette This happend to me today. I would really like to know why/what this is about. Delete file manually? Why could not eclipse do this? Is this a phone bug?Worrywart
I couldn't find the .asec files in the mentioned locations, and erasing the sdcard from the emulator didn't work. It worked when I deleted the sdcard.img in my avd directory.Gooseherd
im having this problem. i cannot see the files/folders using my Mac. is there any other way?Littman
This worked, but could you explain, why it does? What is in the mysterious smdl2tmp1.asec-file?Plumley
I can't find this file (on any path, even on the entire file system), even though the device is rooted. What else can I do?Gloaming
I
224

Change the install location from

android:installLocation="preferExternal"

into

android:installLocation="auto"

in your project's AndroidManifest.xml.

Ieyasu answered 15/4, 2012 at 10:20 Comment(6)
but i want to preferExternal...? How to fix this?Aegina
@AidenFry this is problem of eumlator problem. So change until you test on eumlatorEustacia
@Sameer nope, this occurs on real devices too - but is inconsistent. Main ones are HTC Desire S and Nexus devices.Aegina
yeah, it happened with me on HTC Desire S, and fixed by changing install location to auto. Thanks..Loadstar
@AidenFry Use user2445968 solution if you want to keep preferExternal.Frohman
For those who, like me, didn't have sources of the application, follow the instructions of this site : miui-au.com/add-ons/apktool . apktool provide a very handful feature, decoding, modifying files, and recoding apk's.Dowson
I
45

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
Idette answered 21/4, 2011 at 12:55 Comment(8)
but my device is unrooted, and looking at the secure folder, only root has access. I was able to run the app before, only now since a while, cannot run it and it gives the above error.Granese
btw - there's also a folder /mnt/asec/ that I can reach with non-root, but that's emptyGranese
Ok, turns out I need to mount the sdcard and remove it via pc (.android_secure/smdl2tmp1.asec), then it works again.Granese
@Idette This happend to me today. I would really like to know why/what this is about. Delete file manually? Why could not eclipse do this? Is this a phone bug?Worrywart
I couldn't find the .asec files in the mentioned locations, and erasing the sdcard from the emulator didn't work. It worked when I deleted the sdcard.img in my avd directory.Gooseherd
im having this problem. i cannot see the files/folders using my Mac. is there any other way?Littman
This worked, but could you explain, why it does? What is in the mysterious smdl2tmp1.asec-file?Plumley
I can't find this file (on any path, even on the entire file system), even though the device is rooted. What else can I do?Gloaming
C
32

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.

Commonality answered 11/8, 2011 at 23:59 Comment(4)
Yea it happened same with me. Thumbs up :)Forespent
In addition to increasing the memory I also had to wipe user data and only after that, the new size reflected and the error went away.Protrusile
May I guess that you refer to Internal Storage, and not RAM?Wingate
I increased my AVD's memory, and then wiped data!! and now it's working.Stauffer
H
7

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.

Highway answered 16/4, 2012 at 11:37 Comment(0)
N
6

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.

Nato answered 2/6, 2013 at 21:23 Comment(3)
Welcome to Stack Overflow! Thanks for your post! Please do not use signatures/taglines in your posts. Your user box counts as your signature, and you can use your profile to post any information about yourself you like. FAQ on signatures/taglinesExposure
Resolved this with the same solution, as the problem is cause by an error writing to the SDCard, it is better than the workaorund of Rene f you want to keep android:installLocation="preferExternal".Frohman
Confirm. Error on SD was the reason for me. I tested it removing "prefer external" from manifest - its installed ok.Hallett
F
4

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.

Forestation answered 5/8, 2012 at 22:47 Comment(0)
S
4

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
Sousaphone answered 5/7, 2016 at 17:23 Comment(0)
S
3

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.

Schnell answered 21/3, 2015 at 15:59 Comment(1)
This seemed to be the solution for me running Cyanogenmod 12 (Android 5.0.2). That open seemed to be forcing the app to install on the removable SD card even though the app's manifest specified that it couldn't be installed there.Frankfort
P
2

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.

Poetaster answered 17/6, 2021 at 16:35 Comment(0)
S
1

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.

Salot answered 23/10, 2012 at 9:21 Comment(0)
A
1

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.

Abyssinia answered 10/2, 2016 at 9:53 Comment(0)
H
0

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

Hillell answered 22/6, 2013 at 21:48 Comment(1)
This doesn't really help the OP with their problem, since their concern is getting it working on real world devices, plenty of which still use ARM CPUs.Frederic
B
0

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

Barrick answered 31/3, 2014 at 2:58 Comment(0)
M
0

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.

Mons answered 18/7, 2014 at 10:9 Comment(0)
B
0

Restarting my device fixed the issue for me.

Bye answered 5/1, 2017 at 11:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.