Unable to install package on root device: INSTALL_FAILED_INVALID_URI

This is what I see when I try to install my application on my device (I use 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 seven hells does this error mean?

[Edited] I installed the application on another root device and it worked; It seems that the problem is in my device, and Android Studio is working fine.

+6
source share
4 answers

From this blog, try the following:

Change the permission of /data/local to rwxrwxrwx (usually it should be rwxrwxrw- )

i.e. grant execution rights to all users.

+6
source

I get a similar error message, I fixed it by passing the absolute path instead of the file name, for example. inside the adb shell , this command shows:

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

Change it to the absolute path corrected by that error message, for example:

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

+4
source

Finally, I found that the reason is the resolution of the dir and file.
Android seems to be using a different user to access the directory and file.

chmod 775 / data / local / tmp / somedir ==> rwxrwx rx
chmod 774 / data / local / tmp / somedir / a.apk ==> rwxrwx r -

The above settings will be OK!

0
source

:

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

decision:

check if u is allowed to allow installation from unknown sources :)

enter image description here

0
source

Source: https://habr.com/ru/post/972706/


All Articles