[Solved] INSTALL_FAILED_CONTAINER_ERROR

pluton

Active Member
Licensed User
Longtime User
Today I have problem with one of my app's. The app was a little larger (7 Mb) and I always getting error INSTALL_FAILED_CONTAINER_ERROR

  • I tryed then Uncheck option Can Install To Externall Storage and app still fails
  • I tryed with Restart ADB server but still not luck
  • I tryed to turn off/On my mobile phone but error was still there

The solution is very simple.
You must mount your SD card on your PC and find the folder .android_secure on SD Card. In that folder find the file smdl2tmp1.asec and delete it. :icon_clap:

After that the error has gone and my app compiles without problems.

BTW
I have one question for Erel. Maybe to put this question also in section of Bugs & wishlist

Why is this in Basic4Android app:
If I check option Can Install To Externall Storage in manifest will be
B4X:
android:installLocation="preferExternal">
If option is not checked Can Install To Externall Storage then in manifest we have
B4X:
android:installLocation="internalOnly">

But there is not option in B4A to put that option to auto because install location can be also on auto
B4X:
android:installLocation=["auto" | "internalOnly" | "preferExternal"] >
 

NJDude

Expert
Licensed User
Longtime User
You can do that easily using the Manifest Editor by adding this line:
B4X:
SetManifestAttribute("android:installLocation", "auto")

It should be listed on the IDE (I actually made a wish a while ago but Erel ignored me :()
 
Upvote 0

pluton

Active Member
Licensed User
Longtime User
Thanks for answer NJDude but I know that I can manually edit manifest but I'm lazy so I wish just to click in IDE on "auto" and that is it :)

That is two of us which wish that "auto" option in IDE. Maybe Erel will listen to us now ;)
 
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
Not sure if this is a problem with the emulator. When I try to install an app (dev with B4A) to the emulator using adb (e.g. command of adb install GPSMap.apk), I get INSTALL_FAILED_CONTAINER_ERROR. I've tried installing to the emulator's sdcard (size 100MB) using adb's -s option but get the same error. I have '#CanInstallToExternalStorage: True' in the code.
 
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
Because, at the moment, I'm not able to use the emulator in Windows due to a problem in Wine: so I have tried to use the emulator in my Linux distro (Ubuntu), which requires the app to be installed by adb as B4A runs under Windows (i.e. for me, in Wine).

I can test it in a real device but it's a slightly convoluted procedure to transfer & install in a real device as I can't make B4A compile to a real device: probably due to another problem in Wine.
 
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
I see. Have you tried setting this attribute to false?
I've tried that with no success. I've just got closer with the attribute as True. 'adb install /home/john/Temporary/GPSMap.apk" just failed with "Failure [INSTALL_FAILED_ALREADY_EXISTS]". I've been trying variants of the 'adb uninstall' command e.g. 'adb uninstall dial2000computing.gpsmap' but all fail.

I have in the Region code section:
#ApplicationLabel: GPSMap
#VersionCode: 1
#VersionName:

I have Package name (using the IDE) of dial2000computing.gpsmap. What am I doing wrong?
 
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
Use adb install -r

It will reinstall the package.
Thanks, Erel. It worked for my real device when I used Ubuntu (i.e. not Windows): so things are better on that side.

I mislead you in an earlier posting where I said [INSTALL_FAILED_ALREADY_EXISTS] was corrected for the emulator: it happens for a real device but not for the emulator. I still get [INSTALL_FAILED_CONTAINER_ERROR] for the emulator. I've tried #CanInstallToExternalStorage with both True & False, but both get this error.

Interestingly, 'adb push /home/john/Temporary/GPSMap.apk /sdcard/Download/GPSMap.apk' works OK but I don't see any way of installing to the emulator from this file on the sdcard.
 
Last edited:
Upvote 0

Michaell

Member
Licensed User
Longtime User
Thanks for the advice. It is needed to run the ScrollView example program in the beginner's guide.
 
Upvote 0
Top