Android 安装错误:INSTALL_FAILED_UID_CHANGED 没有root
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20932848/
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
Installation error: INSTALL_FAILED_UID_CHANGED no root
提问by FlamingMoe
I have checked all the solutions, comments and answers of all other questions in StackOverflow.
我已经检查了 StackOverflow 中所有其他问题的所有解决方案、评论和答案。
I have been running, compiling and debugging my app for months. But suddenly it started to appear this message in my Eclipse when using my Nexus to play with it.
几个月来,我一直在运行、编译和调试我的应用程序。但是突然间它开始在我的 Eclipse 中出现这条消息,当我使用我的 Nexus 玩它时。
MOBILE:
移动的:
- I have no root !!! (It's a Nexus, and I have no root, and all the answers in other Stackoverflow's questions need root to be executed)
- The application is uninstalled, there's no trace of it in "Applications"
- Since I don't have root access, I can not access to /data/data folder, or /data/local, or /data
- I doknow problem would be solved resetting the phone to factory settings, but, sincerely, I can not.
- 我没有root!!!(这是一个Nexus,我没有root,其他Stackoverflow问题中的所有答案都需要root才能执行)
- 该应用程序已卸载,“应用程序”中没有它的踪迹
- 由于我没有 root 访问权限,因此无法访问 /data/data 文件夹、/data/local 或 /data
- 我确实知道将手机重置为出厂设置会解决问题,但是,真诚地,我不能。
ECLIPSE:
蚀:
- I have cleaned the project many times, restart Eclipse and even update it
- I can not change the name of the project (as one solution suggests), since it's a long time project and I can not change it
Console says:
- Installation error: INSTALL_FAILED_UID_CHANGED
- Please check logcat output for more details.
- Launch canceled!
Logcat says:
- 01-05 12:18:19.265: W/ActivityManager(761): No content provider found for permission revoke: file:///data/local/tmp/MyApp.apk
- 01-05 12:18:20.855: W/PackageManager(761): Package couldn't be installed in /data/app/com.myapp-1.apk
I can install, uninstall other APK/applications with no problems at all. So it's not about permissions in /data folder/subfolders
- 我已经多次清理项目,重新启动Eclipse甚至更新它
- 我无法更改项目名称(正如一个解决方案所建议的那样),因为这是一个很长的项目,我无法更改它
控制台说:
- 安装错误:INSTALL_FAILED_UID_CHANGED
- 请检查 logcat 输出以获取更多详细信息。
- 发射取消!
Logcat 说:
- 01-05 12:18:19.265: W/ActivityManager(761): 找不到内容提供者进行权限撤销:file:///data/local/tmp/MyApp.apk
- 01-05 12:18:20.855:W/PackageManager(761):包无法安装在/data/app/com.myapp-1.apk
我可以毫无问题地安装、卸载其他 APK/应用程序。所以这与 /data 文件夹/子文件夹中的权限无关
CONSOLE:
安慰:
- If I try to uninstall (with -d or any other parameter) the app it says: "Failure" (because adb does not find the app in the phone)
- 如果我尝试卸载(使用 -d 或任何其他参数)该应用程序,它会显示:“失败”(因为 adb 在手机中找不到该应用程序)
So, I'm not debugging with virtual machine / emulator. I have a Nexus no-rooted with no trace of the application, and I can not build the app from Eclipse to the device.
所以,我不是在使用虚拟机/模拟器进行调试。我有一个没有根的 Nexus,没有应用程序的痕迹,我无法从 Eclipse 构建应用程序到设备。
Thank you
谢谢
回答by Christian García
I had the same issue in my non-rooted Nexus 5. I managed to solve it without root access nor Factory reset.
我在非 root 的 Nexus 5 中遇到了同样的问题。我设法在没有 root 访问权限或 Factory reset 的情况下解决了它。
For this device, I managed to solve it by going to Settings -> Storage -> Misc
and try to delete any files related to the faulty app (in my case, an .apk that was pushed from Android Studio and a .db file). I also clicked on Cached data
to wipe the cache for all apps.
对于此设备,我设法通过转到Settings -> Storage -> Misc
并尝试删除与故障应用程序相关的任何文件(在我的情况下,是从 Android Studio 推送的 .apk 和 .db 文件)来解决它。我还单击Cached data
以擦除所有应用程序的缓存。
I don't know exactly which of the two things triggered the solution. You probably want to try to delete some files in Misc
before wiping the cached data, since it seems less of an overkill.
我不知道这两件事中的哪一件触发了解决方案。您可能想Misc
在擦除缓存数据之前尝试删除一些文件,因为这似乎不是一种矫枉过正的做法。
It seems to be that there were some remaining files from a previous installation which weren't wiped with the uninstall (probably an issue in the Android installation system). These files aren't accessible without root access, since they are under the /data/local/ folder. Apparently the Storage tools for the Nexus 5 have permission to delete files under that folder.
似乎有一些以前安装的剩余文件没有在卸载时擦除(可能是 Android 安装系统中的一个问题)。这些文件在没有 root 访问权限的情况下无法访问,因为它们位于 /data/local/ 文件夹下。显然,Nexus 5 的存储工具有权删除该文件夹下的文件。
I don't know whether other devices have a similar set of storage tools.
不知道其他设备有没有类似的存储工具。
回答by Sunil Kumar
Downloading app from play store will resolve the issue. To continue development on the app, uninstall the currently installed app and just launch the app from eclipse.
从 Play 商店下载应用程序将解决该问题。要继续开发应用程序,请卸载当前安装的应用程序,然后从 eclipse 启动该应用程序。
It works fine.
它工作正常。
回答by DustinB
This may seem odd, but my pointy-haired boss just had this issue and tried everything we could think of. Just would NOT install due to the INSTALL_FAILED_UID_CHANGED error.
这可能看起来很奇怪,但我的尖头发老板刚刚遇到了这个问题,并尝试了我们能想到的一切。由于 INSTALL_FAILED_UID_CHANGED 错误,只是不会安装。
He uninstalled some other apps (games) and suddenly it would install. Maybe it is an issue of disk space on internal card? Dunno, but worth a try when someone else hits it.
他卸载了一些其他应用程序(游戏),突然间它会安装。也许是内部卡上的磁盘空间问题?不知道,但是当其他人击中它时值得一试。
回答by guyland123
First time this happened I tried installing from eclipse, from command line etc.... Everything failed so I did a factory reset which then worked.
第一次发生这种情况时,我尝试从 Eclipse、命令行等进行安装......一切都失败了,所以我进行了出厂重置,然后工作。
24 hours later it happened again.
24小时后,又发生了。
Not wanting to do another factory reset, I tried all the same things again to no avail.
不想再次恢复出厂设置,我再次尝试了所有相同的事情,但无济于事。
Lastly I tried downloading our current app from the appstore, which miraculously worked.
最后,我尝试从 appstore 下载我们当前的应用程序,它奇迹般地工作了。
I then used adb to reinstall.
然后我使用adb重新安装。
So if you have a version of your app in the app store, try installing that to get something on your phone, then do a reinstall "adb -d install -r $PACKAGE.apk
因此,如果您在应用商店中有某个版本的应用,请尝试安装该版本以在您的手机上获取某些内容,然后重新安装“adb -d install -r $PACKAGE.apk
Hope this helps someone.
希望这可以帮助某人。
回答by Viachaslau Tysianchuk
This (or some other magic) helped me:
这(或其他一些魔法)帮助了我:
adb shell pm clear MY_PACKAGE_NAME
回答by Mo?ze
Try deleting Cached Data under Settings -> Storage
, this will clear all cached App data at once, but it does the job (in my case)
尝试删除 下的缓存数据Settings -> Storage
,这将立即清除所有缓存的应用程序数据,但它可以完成工作(在我的情况下)
回答by scottt
Here are some other things to check/try that are safe to do:
以下是其他一些可以安全检查/尝试的事情:
- Make sure your package name is 100% unique and not colliding with another app. You could temporarily change it to test.
- Try powering your phone off and then back on to clear data caches.
- Try a soft reset for your device (which might be the same as powering off/on).
- 确保您的包名称 100% 唯一并且不会与其他应用程序冲突。您可以暂时更改它以进行测试。
- 尝试关闭手机电源,然后重新开启以清除数据缓存。
- 尝试对您的设备进行软重置(这可能与关闭/打开电源相同)。
回答by TJ Kim
I can solve this like below without rooting on my Nexus 5.
我可以像下面这样解决这个问题,而无需在我的 Nexus 5 上扎根。
- Push your app to /sdcard/
- adb push test.apk /sdcard/
- adb shell
- adb shell pm install -l /sdcard/test.apk
- 将您的应用推送到 /sdcard/
- adb push test.apk /sdcard/
- 亚行外壳
- adb shell pm install -l /sdcard/test.apk
-l option means - pm install: installs a package to the system. Options: -l: install the package with FORWARD_LOCK.
-l 选项的意思是 - pm install:安装一个包到系统。选项: -l:使用 FORWARD_LOCK 安装包。
回答by Karim Varela
This worked for me:
这对我有用:
adb install -l -r <'apk_name'>.apk
adb install -l -r <'apk_name'>.apk
-l = forward lock
-l = 前向锁定
-r = reinstall
-r = 重新安装
回答by Tim S. Van Haren
I had this exact same problem. What finally worked for me was to change the applicationId
(your package name) in build.gradle
to something different, then rebuild the project, and voilà, successful deployment.
我有这个完全相同的问题。最终对我有用的是将applicationId
(您的包名称)更改为build.gradle
不同的内容,然后重建项目,瞧,成功部署。
What led to this situation was that I'd copied an existing Android Studio project into a new one, and was working off of that new one. The thing is, I'd never deployed the original apk on my device before, and was only trying to deploy the new copy of the app.
导致这种情况的原因是我将一个现有的 Android Studio 项目复制到一个新项目中,并且正在处理这个新项目。问题是,我以前从未在我的设备上部署过原始 apk,只是试图部署应用程序的新副本。