Computerish
Computerish

Reputation: 9591

Android INSTALL_FAILED_INVALID_URI

I just started getting the following error when I attempt to install an Android application to a device through Eclipse:

Installation failed due to invalid URI!
Please check logcat output for more details.
Launch canceled!

I've also tried installing both the APK in the bin folder and a signed APK through adb. When I do this, I get an INSTALL_FAILED_INVALID_URI error.

I haven't changed anything about my setup, and it used to work without a problem.

Any ideas? Thanks!

LogCat output:

D/AndroidRuntime(32345): CheckJNI is OFF
D/dalvikvm(32345): Unable to stat classpath element '/system/framework/com.orange.authentication.simcard.jar'
D/AndroidRuntime(32345): Calling main entry com.android.commands.pm.Pm
V/Performance(32111): >>com.android.defcontainer.DefaultContainerService@40d944a8 onCreate
V/Performance(32111): <<com.android.defcontainer.DefaultContainerService@40d944a8 onCreate, 3ms
V/Performance(32111): >>com.android.defcontainer.DefaultContainerService@40d944a8 onBind
V/Performance(32111): <<com.android.defcontainer.DefaultContainerService@40d944a8 onBind, 1ms
W/asset   (32111): Asset path /data/local/tmp/CS2110Project.apk is neither a directory nor file (type=0).
W/DefContainer(32111): Failed to parse package
W/ActivityManager(  744): No content provider found for permission revoke: file:///data/local/tmp/CS2110Project.apk
D/dalvikvm(  744): GC_EXPLICIT freed 1196K, 36% free 20088K/31267K, paused 10ms+14ms
D/AndroidRuntime(32345): Shutting down VM
I/AndroidRuntime(32345): NOTE: attach of thread 'Binder Thread #3' failed
D/dalvikvm(32345): GC_CONCURRENT freed 135K, 72% free 578K/2048K, paused 1ms+1ms
D/dalvikvm(32345): Debugger has detached; object registry had 1 entries

Upvotes: 15

Views: 53156

Answers (13)

Paul
Paul

Reputation: 428

In my case, I was giving the wrong command. I thought I needed to specify the device, so I was doing:

adb install -s X0Y1ZZ23456789XY "G:\com.my.apk"

when I should've been doing:

adb install "G:\com.my.apk"

The thing is: the apk was transferring fine, it just failed at the end like this. Like others have said, it's a shame you don't get better errors from this tool. :-|

Upvotes: 0

Constantin N.
Constantin N.

Reputation: 2839

Rebooting my device solved the issue

Upvotes: 0

J.Z
J.Z

Reputation: 935

you need to run

readlink -f PATH_of_APK

or

readlink -e PATH_of_APK

first to get the legal path for pm command.

E.g. on my termux:

$readlink -f /data/data/com.termux/files/home/storage/downloads/

/storage/emulated/0/Download

Upvotes: 0

FrankRizzo
FrankRizzo

Reputation: 171

For ME, it wanted the full path.

  • pm install joe.apk failed.
  • pm install ./joe.apk failed.
  • chmod'ed everything, still failed.
  • pm install /data/joe.apk worked.

Upvotes: 17

luckyhandler
luckyhandler

Reputation: 11329

In my case it was a console issue. I used the "terminal" on the Mac and it didn't work. When I used the build in console of AndroidStudio it worked though.

Upvotes: 0

Sachin Mokashi
Sachin Mokashi

Reputation: 437

When you do an "adb install -r some_app.apk", it gives the pkg as "/data/local/tmp/some_app.apk Success". If you give the option -r in a wrong place it takes the pkg as -r and gives the above error. Hence after chmod of data, local & tmp dir, check if it is able to parse pkg properly.

Upvotes: 1

taotao
taotao

Reputation: 847

on my device is because of minSdkVersion is below than you device android sdk

Upvotes: 1

D. Gibbs
D. Gibbs

Reputation: 560

I know this is an old question but it might still help someone.

I ran into this same problem when installing a list of apps from a text file, so I can install them programmatically. I created the file in Windows then pushed it to tablet with ADB. Windows puts a carriage return and line feed at the end of every line.

Make sure that there is only a line feed (make the file on *nix box or remove CR from Windows file) at the end of every line

Upvotes: 0

Langusten Gustel
Langusten Gustel

Reputation: 11002

Just for the record:

For me it turned out to be an umlaut (ä,ü,ö) Problem in the Project name.

I did the following to solve it:

  1. Refactor -> Rename (replaced the umlauts)
  2. did a Project -> Clean

Hope this saves some time to others… took me quite a while.

Upvotes: 10

ingyesid
ingyesid

Reputation: 2884

not have accents or unusual characters. I had the accent and the name of the apk generated an error when going to install, remove the tick and it worked

Upvotes: 5

Rit Man
Rit Man

Reputation: 51

For me, I rooted my device and every time i turn the phone on it re-updates android. With that in mind, I had to reset the chmod 777 to the local directory. So this is more of a reminder to check your permissions then an answer but it may help someone.

Upvotes: 5

Computerish
Computerish

Reputation: 9591

Turned out to be a ROM issue. I reflashed to a newer ROM and everything works just fine now. Seems to be a fairly common problem actually.

Upvotes: 8

dwemthy
dwemthy

Reputation: 471

Do you have your device set up for debugging? If you haven't already you might need to go to Settings -> Applications and allow Unknown Sources. If that doesn't help: what's in your logcat output?

Upvotes: 3

Related Questions