Android Eclipse 安装错误:INSTALL_FAILED_UID_CHANGED
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12338242/
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
Eclipse Installation error: INSTALL_FAILED_UID_CHANGED
提问by Mohsen Navabi
I have problem with running an android application from eclipse on real android device
我在真正的 android 设备上从 eclipse 运行一个 android 应用程序时遇到问题
when I click on Run it just show me this error:
Installation error: INSTALL_FAILED_UID_CHANGED
当我单击“运行”时,只显示此错误:安装错误: INSTALL_FAILED_UID_CHANGED
Logcat:
日志猫:
[2012-09-09 14:38:26 - SearchApp] Android Launch!
[2012-09-09 14:38:26 - SearchApp] adb is running normally.
[2012-09-09 14:38:26 - SearchApp] Performing com.example.MainActivity activity launch
[2012-09-09 14:38:26 - SearchApp] Automatic Target Mode: using device 'cff192abd7f551f'
[2012-09-09 14:38:26 - SearchApp] Uploading SearchApp.apk onto device 'cff192abd7f551f'
[2012-09-09 14:38:27 - SearchApp] Installing SearchApp.apk...
[2012-09-09 14:38:28 - SearchApp] Installation error: INSTALL_FAILED_UID_CHANGED
[2012-09-09 14:38:28 - SearchApp] Please check logcat output for more details.
[2012-09-09 14:38:28 - SearchApp] Launch canceled!
采纳答案by Mohsen Navabi
I EVENTUALLY FOUND THE SOLUTION FOR INSTALL_FAILED_DEXOPT and INSTALL_FAILED_UID_CHANGED ERROR
我最终找到了 INSTALL_FAILED_DEXOPT 和 INSTALL_FAILED_UID_CHANGED 错误的解决方案
After lot of testing a vary of tricks in vain, I eventually found the main solution to solve this sticky problem forever!
经过大量测试各种技巧徒劳无功,我最终找到了永远解决这个棘手问题的主要解决方案!
I think the problem is caused by an Eclipse bug! , in fact eclipse can not copy and install built APK file just because of a string name(described further)
我认为问题是由 Eclipse 错误引起的!, 事实上 eclipse 不能仅仅因为一个字符串名称就复制和安装构建的 APK 文件(进一步描述)
I should add that when you use tricks on internet such as delete package name folder in data/data you will face a new sticky error "INSTALL_FAILED_DEXOPT"
我应该补充一点,当您在互联网上使用技巧(例如删除数据/数据中的包名文件夹)时,您将面临新的粘性错误“ INSTALL_FAILED_DEXOPT”
So lets see how to solve INSTALL_FAILED_DEXOPTand INSTALL_FAILED_UID_CHANGED
那么让我们看看如何解决INSTALL_FAILED_DEXOPT和INSTALL_FAILED_UID_CHANGED
In my case, when i check the log cat i noticed below lines:
就我而言,当我检查 log cat 时,我注意到以下几行:
09-30 19:03:19.882: I/PackageManager(314): Running dexopt on: com.example.searchapp
09-30 19:03:19.921: E/dalvikvm(6129): Invalid name: 'search_?country_name'
09-30 19:03:19.921: E/dalvikvm(6129): Trouble with item 226 @ offset 0x2094
09-30 19:03:19.921: E/dalvikvm(6129): Cross-item verify of section type 0004 failed
09-30 19:03:19.921: E/dalvikvm(6129): ERROR: Byte swap + verify failed
09-30 19:03:19.961: E/dalvikvm(6129): Optimization failed
09-30 19:03:19.961: W/installd(144): DexInv: --- END '/data/app/com.example.searchapp-1.apk' --- status=0xff00, process failed
09-30 19:03:19.961: E/installd(144): dexopt failed on '/data/dalvik-cache/data@[email protected]@classes.dex' res = 65280
09-30 19:03:19.961: W/PackageManager(314): Package couldn't be installed in /data/app/com.example.searchapp-1.apk
As you can see the second line is: Invalid name: 'search_?country_name'
如您所见,第二行是:Invalid name: 'search_?country_name'
This is one of my string names in String.xml
这是我在 String.xml 中的字符串名称之一
So I delete this string and comment all referenced codes
所以我删除这个字符串并注释所有引用的代码
Then I delete the package name folder in /data/data (if you are using a actual device you should have root access , if you are using emulator just wipe data before opening emulator or make a new AVD)
然后我删除 /data/data 中的包名文件夹(如果您使用的是实际设备,您应该具有 root 访问权限,如果您使用的是模拟器,只需在打开模拟器之前擦除数据或制作新的 AVD)
Now the problem is solved!
现在问题解决了!
You can easily continue coding!
您可以轻松地继续编码!
回答by Chris Dolan
This solution finally worked for me with no root:
这个解决方案终于在没有root的情况下对我有用:
$ platform-tools/adb -d install /path/to/proj/bin/foo.apk
797 KB/s (4872885 bytes in 5.963s)
pkg: /data/local/tmp/foo.apk
Success
$ platform-tools/adb -d uninstall com.example.foo.bar
Success
I don't completely understand why this worked when installing from Eclipse did not work for the same APK, but I'm just happy to move on...
我不完全明白为什么从 Eclipse 安装时这有效,但对同一个 APK 不起作用,但我很高兴继续前进......
回答by djdance
I tried all this answers but no effect
我尝试了所有这些答案,但没有效果
uproperly uninstall.
正确卸载。
solution: just reboot pad
解决方案:只需重启pad
回答by balaji
It may be possible that the application did not get uninstalled properly. There may be data folder left out. So try to remove data folder of the application manually and try installing the application again.
应用程序可能没有被正确卸载。可能遗漏了数据文件夹。因此,请尝试手动删除应用程序的数据文件夹,然后再次尝试安装该应用程序。
回答by Edward
Alternatively, delete the emulator and reconfigure it afresh.
或者,删除模拟器并重新配置它。
回答by Yura Shinkarev
May be anybody help...
可能有人帮忙...
I have root device for debug. Sometimes I backup my application data from /data/data/my.package and later restore by adb shell. Before on restore I delete my.package folder, recreate and copy other subfolders and files. After this on next change and run project from eclipse, get INSTALL_FAILED_UID_CHANGED error.
我有用于调试的根设备。有时我从 /data/data/my.package 备份我的应用程序数据,然后通过 adb shell 恢复。在恢复之前,我删除 my.package 文件夹,重新创建并复制其他子文件夹和文件。在下一次更改并从 Eclipse 运行项目之后,得到 INSTALL_FAILED_UID_CHANGED 错误。
My mistake: I should not have been removed my.package folder. I must remove only all in this folder, because on recreate folder I get new owner folder my.package.
我的错误:我不应该删除 my.package 文件夹。我必须只删除此文件夹中的所有内容,因为在重新创建文件夹时,我会获得新的所有者文件夹 my.package。
回答by SonalG
There is a work around for it. If you do not have rooted device and you cannot access /data/data/ folder also, then simply reset your device. It will delete everything from data folder and you can install clean app again. Only drawback is everything will get erased from your phone.
有一个解决方法。如果您没有 root 设备并且您也无法访问 /data/data/ 文件夹,那么只需重置您的设备。它将删除数据文件夹中的所有内容,您可以再次安装干净的应用程序。唯一的缺点是所有内容都会从手机中删除。
回答by Anna Billstrom
I had this issue on the emulator. I removed the avd and created a new one. Problem went away.
我在模拟器上有这个问题。我删除了 avd 并创建了一个新的。问题消失了。
回答by Najeebullah Shah
There is already a data directory with the name of package you are trying to install with a different UID assigned. Get a root access and then try removing the already existed directory with the following command in cmd
已经有一个数据目录,其中包含您尝试安装的包名称,并分配了不同的 UID。获取 root 访问权限,然后尝试在 cmd 中使用以下命令删除已经存在的目录
rm -r /data/data/com.your.package
Or try to rename your application package to run it on your device.
或者尝试重命名您的应用程序包以在您的设备上运行它。
回答by asok Buzz
So if you come this down to find this.. nothing might have worked for you. There is however an easy fix for this. It is obviously because of improper uninstall (probably due to faulty cable connection).
所以如果你下来找到这个......没有什么对你有用。然而,对此有一个简单的解决方法。显然是因为卸载不当(可能是由于电缆连接错误)。
SOLUTIONDownload SDMaidfrom play-store, and delete Corpse files (junk files). Re-run application. (But you need to have your device rooted)
解决方案从游戏商店 下载SDMaid,并删除尸体文件(垃圾文件)。重新运行应用程序。(但你需要让你的设备植根)