Today, for the first time ever, my EVO 4G had an unexpected failure installing updates for some of my Android apps. All update attempts would inevitably end in an almost instant failure with the message that read:

Installation error

Couldn't install on USB storage or SD card

The weird part was that some apps installed OK but some got stuck in a perma-fail mode and could no longer be updated. After mucking around for a bit, I dug into the logs and found the following relevant log line:

Failed to create secure container smdl2tmp1

Aha! Now what the heck is smdl2tmp1?

After digging around the Internet some more, I found that the problem is caused by a temporary file called smdl2tmp1.asec that is used during some installations (I think of apps that are movable to SD) but does not get deleted for some reason, most notably when you run out of space. Because of this, the system can't create it and treats it as an error, rather than figuring out that it's stale and simply deleting it.

The solution? Go and delete smdl2tmp1.asec yourself. From what I can tell, it could reside in 2 locations:

  1. /sdcard/.android_secure - this is an invisible folder on your SD card, which you can access with any file manager, like ASTRO
  2. /mnt/secure/asec/ - access to this folder requires root and a program like Root Explorer

Look for smdl2tmp1.asec in these folders and delete any ones you see. Deleting it seems to be a safe enough operation - it's just a temporary file after all. Once you've done that, all the update problems should go away:

I/logwrapper(  170): /system/bin/newfs_msdos terminated by exit(0)
I/PackageHelper(15175): Created secure container smdl2tmp1 at /mnt/asec/smdl2tmp1
I/DefContainer(15175): Created container for smdl2tmp1 at path : /mnt/asec/smdl2tmp1
I/DefContainer(15175): Copied /cache/32.apk to /mnt/asec/smdl2tmp1/pkg.apk
I/DefContainer(15175): Finalized container smdl2tmp1
I/DefContainer(15175): Unmounting smdl2tmp1 at path /mnt/asec/smdl2tmp1

Later on, I found this bug discussing the situation and slamming Google left and right for not fixing this problem and requiring users to look for random files on their phones, which I wholeheartedly agreed with.

Oh well, at least my phone is healthy again, and I hope yours is too, as you probably found this page while looking for a solution.