Cannot install package on rooted device : INSTALL_FAILED_INVALID_URI

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.


symptoms: `

$ adb install xyz.apk
[100%] /data/local/tmp/xyz.apk
    pkg: cat
    ver: /data/local/tmp/xyz.apk
Failure [INSTALL_FAILED_INVALID_URI]

solution:

check if u have allow installation from unknown sources enabled :)

enter image description here


Finally, I found the reason is dir and file permission.
Android seems to use another user to access the dir and file.

chmod 775 /data/local/tmp/somedir         ==> rwxrwx<b>r-x</b><br>
chmod 774 /data/local/tmp/somedir/a.apk   ==> rwxrwx<b>r</b>--<br>

The above setting will be OK!


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.