简体   繁体   中英

Cannot install Android app in my device from Android Studio

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?

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM