Android INSTALL_FAILED_INVALID_URI

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10142216/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 02:39:19  来源:igfitidea点击:

Android INSTALL_FAILED_INVALID_URI

androidapk

提问by Computerish

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

当我尝试通过 Eclipse 将 Android 应用程序安装到设备时,我刚刚开始收到以下错误:

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 binfolder and a signed APK through adb. When I do this, I get an INSTALL_FAILED_INVALID_URIerror.

我还尝试bin通过 adb安装文件夹中的 APK和签名的 APK。当我这样做时,我收到一个INSTALL_FAILED_INVALID_URI错误。

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

我没有对我的设置进行任何更改,它曾经可以正常工作。

Any ideas? Thanks!

有任何想法吗?谢谢!

LogCat output:

LogCat 输出:

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

采纳答案by Computerish

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.

原来是ROM的问题。我重新刷到更新的 ROM,现在一切正常。实际上似乎是一个相当普遍的问题。

回答by FrankRizzo

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.
  • pm install joe.apk 失败。
  • pm install ./joe.apk 失败。
  • chmod'ed 一切,仍然失败。
  • pm install /data/joe.apk 工作。

回答by Langusten Gustel

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
  1. Refactor-> Rename(替换了元音变音)
  2. 做了一个Project->Clean

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

希望这可以为其他人节省一些时间……花了我很长时间。

回答by Rit Man

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.

对我来说,我植根了我的设备,每次打开手机时都会重新更新 android。考虑到这一点,我不得不将 chmod 777 重置到本地目录。因此,这更多是提醒您检查您的权限,然后是一个答案,但它可能会对某人有所帮助。

回答by ingyesid

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

没有重音或不寻常的字符。我在安装时有口音和 apk 的名称生成错误,删除勾号并且它工作

回答by dwemthy

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?

您的设备是否设置为调试?如果您还没有,您可能需要转到设置 -> 应用程序并允许未知来源。如果这没有帮助:您的 logcat 输出中有什么?

回答by taotao

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

在我的设备上是因为 minSdkVersion 低于您的设备 android sdk

回答by Sachin Mokashi

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.

当您执行“adb install -r some_app.apk”时,它会将 pkg 显示为“/data/local/tmp/some_app.apk Success”。如果您在错误的位置提供选项 -r,它会将 pkg 作为 -r 并给出上述错误。因此,在对数据、本地和 tmp 目录进行 chmod 之后,检查它是否能够正确解析 pkg。

回答by luckyhandler

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.

就我而言,这是一个控制台问题。我在 Mac 上使用了“终端”,但没有用。当我在 AndroidStudio 的控制台中使用构建时,它虽然有效。

回答by D. Gibbs

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.

从文本文件安装应用程序列表时,我遇到了同样的问题,因此我可以以编程方式安装它们。我在 Windows 中创建了该文件,然后使用 ADB 将其推送到平板电脑。Windows 在每行的末尾放置一个回车和换行符。

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

确保每行末尾只有一个换行符(在 *nix 框中创建文件或从 Windows 文件中删除 CR)