Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install package on rooted device : INSTALL_FAILED_INVALID_URI

This is what I see when I try to install my app on my device (I'm using Android Studio 0.8.2):

Waiting for device.
Target device: samsung-gt_s7500-cf994b04
Uploading file
local path: C:\Users\Administrator\AndroidStudioProjects\Testaqua\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/com.example.administrator.testaqua
Installing com.example.administrator.testaqua
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.administrator.testaqua"
pkg: /data/local/tmp/com.example.administrator.testaqua
Failure [INSTALL_FAILED_INVALID_URI]

What in the seven hells does this error mean?

[Edited] I installed my app on another rooted device, and it worked; it seems the problem is my device, android studio is running fine.

like image 396
elmazzun Avatar asked Jul 23 '14 13:07

elmazzun


2 Answers

I get similar error message, I fixed it by passing the absolute path instead of filename, e.g. inside adb shell, this command will shows:

shell@example:/sdcard $ pm install -r -d app-release.apk
        pkg: app-release.apk
Failure [INSTALL_FAILED_INVALID_URI]

Change it to absolute path fixed that error message, e.g.:

pm install -r -d /sdcard/app-release.apk

[Second reason]

Another reason is the file not exist. It happen when I interrupt adb push <apk> /sdcard/ by Ctrl+C recently. Re-push apk twice required.

[Third reason]

This error occurred if the apk reside /mnt/runtime/default/<thumb_drive_mounted_directory>, I have to move the apk to /sdcard/ first to install.

like image 131
林果皞 Avatar answered Nov 18 '22 08:11

林果皞


From this blog try this :

Change permission of /data/local to rwxrwxrwx (normally it must be rwxrwxrw-)

i.e. grant execution privileges to all users.

like image 10
ben75 Avatar answered Nov 18 '22 08:11

ben75