1

I build a very simple example using Android Studio 1.1 Beta4 and trying to deploying it in my device which is a Samsung S4 (Int) that runs a Cyanogenmod12 ROM. I always get the following error:

Waiting for device.
Target device: samsung-gt_i9505-dd755d6b
Uploading file
    local path: C:\workspaces\androidws\ButtonsExample\app\build\outputs\apk\app-debug.apk
    remote path: /data/local/tmp/com.kpor.android.buttonsexample
Installing com.kpor.android.buttonsexample
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.kpor.android.buttonsexample"
pkg: /data/local/tmp/com.kpor.android.buttonsexample
Failure [INSTALL_FAILED_CONTAINER_ERROR]

The output from adb shell df is:

Filesystem               Size     Used     Free   Blksize
/dev                   905.2M    48.0K   905.2M   4096
/sys/fs/cgroup         905.2M    12.0K   905.2M   4096
/mnt/asec              905.2M     0.0K   905.2M   4096
/mnt/obb               905.2M     0.0K   905.2M   4096
/system                  1.1G   678.4M   430.3M   4096
/cache                   2.0G    35.6M     2.0G   4096
/firmware               86.0M     9.0M    76.9M   16384
/firmware-mdm           86.0M    49.8M    36.1M   16384
/efs                    13.4M     4.4M     9.0M   4096
/data                    9.1G     7.5G     1.6G   4096
/mnt/shell/emulated      9.1G     7.5G     1.6G   4096
/mnt/media_rw/sdcard1: Permission denied
/storage/sdcard1        50.6G    45.1G     5.4G   4096
/data/media/0/Android/data/com.androidauthority: Permission denied

I cannot figure out what causes this error. Any ideas?

gfot
  • 95
  • 2
  • 11
  • have you choose the `unknown resourse` in your seeting? – Xcihnegn Feb 11 '15 at 13:38
  • Yes. Security > Unknown sources > "Enabled". Developer Options > Root access > "Apps and ADB". – gfot Feb 11 '15 at 13:43
  • what that means `/mnt/media_rw/sdcard1: Permission denied` and `/data/media/0/Android/data/com.androidauthority: Permission denied` – Xcihnegn Feb 11 '15 at 13:47
  • To tell you the truth I do not know! I suppose that it happens because the device is connected with the PC and so MTP is enabled and mount the external memory card to PC's filesystem. I may be wrong, it's just an assumption. Also the "Permission denied" in the `/data/com.androidauthority` I do not know why it happens... – gfot Feb 11 '15 at 13:56
  • have you try copy the apk to sdcard then install? see waht happen – Xcihnegn Feb 11 '15 at 13:59
  • Yes I have copied the "app-debug.apk" and "app-debug-unaligned.apk" in the Download folder of internal memory. I have unplugged the USB cable and tried to install but I get a "App not installed" message for both apks. Also in the manifest of the app I have the `android:installLocation="auto"` but same results... (also for "internalOnly" value). – gfot Feb 11 '15 at 14:04
  • seems to be no enough room to install, check memory available – Xcihnegn Feb 11 '15 at 14:15
  • As you can see from the output of `adb shell df` command there is plenty of memory space both internal and external sdcard. – gfot Feb 11 '15 at 14:17
  • because you have `Failure [INSTALL_FAILED_CONTAINER_ERROR]` – Xcihnegn Feb 11 '15 at 14:29
  • Yes I understand that this is an indication of memory space, but I have about 2GB in internal SDcard and 5GB in external. And the app is just a button, about 30kb... – gfot Feb 11 '15 at 14:38
  • hope this [link](http://www.drawbackz.com/stack/20953/what-does-this-mean-failure-install_failed_container_error.html) help you – Xcihnegn Feb 11 '15 at 14:46
  • Thanks for pointing this out! Unfortunately, I have already read it and tried to follow it, but there is no `smdl2tmp1.asec` in the specified path. Note that I have root access. – gfot Feb 11 '15 at 14:49

1 Answers1

1

Finally, I figured out what happened... I read a post (link below) and all I had to do is:

Go to: Settings > Apps > Click on the menu and then select Preferred install location.

I changed that from "Let the system decide" to "Internal device storage". After the change I was able to install any APK file using Android Studio.

http://www.reddit.com/r/cyanogenmod/comments/2uv9hn/cm12_apk_install_issue/

gfot
  • 95
  • 2
  • 11