软件包 xyz 的 uid 不匹配:磁盘上为 10044,设置中为 10045
我找到了一个在虚拟机中安装 Android-x86 的简单指南(指南)。
连接到 Eclipse 并且一切正常,但在 VM 上安装我的应用程序失败并出现以下错误:
06-21 22:40:26.390: INFO/PackageManager(2439): /data/app/xyz.apk changed; unpacking
06-21 22:40:26.390: ERROR/PackageManager(2439): Package xyz has mismatched uid: 10044 on disk, 10045 in settings
06-21 22:40:26.390: WARN/PackageManager(2439): Native ABI mismatch from package file
06-21 22:40:26.390: WARN/PackageManager(2439): Package couldn't be installed in /data/app/xyz-1.apk
我在 google 上搜索了错误并找到了一个小 Python 脚本来解决问题,但它不起作用 (脚本)。执行脚本后我得到了同样的错误。
我使用 Android-x86 2.2 通用版本,更多详细信息可以在这里找到: Release 2.2
是有可能解决这个问题吗?
编辑:
我测试了所有 2.2 版本。一般情况下,只有 generic 和 sparta 可以工作,但没有人接受我的 apk。
也尝试使用 adb install
。
EDIT2:
我已经尝试过@Vlad建议的工具。它在签署 apk 后部分起作用。最后我使用了 apkTools 并将 apkEdit 的旧文件替换为来自 apktool 的新内容。
但是使用 adb 安装会挂起,并显示消息正在等待设备或什么也没有。如果我相信 eclipse DDMS,每次我尝试安装 apk 时,与设备的连接都会丢失。
当我尝试安装正常 apk 时,出现以下错误:失败 [INSTALL_FAILED_INVALID_APK]
I found a simple guide to install an Android-x86 in a VM (guide).
Connection to Eclipse and all works fine, but installing my app on the VM fails with following errors:
06-21 22:40:26.390: INFO/PackageManager(2439): /data/app/xyz.apk changed; unpacking
06-21 22:40:26.390: ERROR/PackageManager(2439): Package xyz has mismatched uid: 10044 on disk, 10045 in settings
06-21 22:40:26.390: WARN/PackageManager(2439): Native ABI mismatch from package file
06-21 22:40:26.390: WARN/PackageManager(2439): Package couldn't be installed in /data/app/xyz-1.apk
I searched for the error at google and found a little Python script to fix the issue, but it doesn't work (script). After the execution of the script I got the same error.
I use Android-x86 2.2 generic, more details can be found here: Release 2.2
Is there any possibility to fix that problem?
EDIT:
I tested all 2.2 releases. Only generic and sparta work in general, but no one accepts my apk.
Tried with adb install <packagefile>
too.
EDIT2:
I have tried the adviced tools from @Vlad. It works partially after signing the apk. Finally I used the apkTools and replaced the old files of apkEdit with the new from the apktool.
But the install with adb hangs up with the message waiting for device or nothing. If I believe eclipse DDMS the connection to the device will lost every time I try to install the apk.
Here is the failure when I try to install the normal apk: Failure [INSTALL_FAILED_INVALID_APK]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
错误
包 xyz 的 uid 不匹配:磁盘上为 10044,设置中为 10045
,由现有文件夹/data/data/xyz/
引起。此消息文件夹中存在,并且具有与现在安装的 (10045) 不同的所有者 (10044)。这是由于之前安装不干净造成的。
例如,之前的安装因一些错误而失败,并且不要删除创建的文件夹。
因为文件夹中可能有来自其他应用程序的数据,所以 Android 不允许使用它。
PackageManager
尝试以不同的方式修复它,但如果不能做到这一点 - 它会获取应用程序不同的目录并显示此消息。更好的解决方案 - 安装应用程序并干净删除它。之后再次安装。
另一个解决方案 - 以某种方式删除文件夹
/data/data/xyz/
。可能你需要 root 才能做到这一点。来自
PackageManager
的代码(注释可能非常有帮助):Error
Package xyz has mismatched uid: 10044 on disk, 10045 in settings
caused by exist folder/data/data/xyz/
.In this message folder exists and have different owner (10044) from now installed (10045). It is caused by previous unclean install.
For example previous install failed with some errors and do not remove created folders.
Because in folder can be data from other app android can not allow use it.
PackageManager
try fix it in different ways but if can not do this - it get app different dir and show this message.Better solution - install app and clean remove it. After that install it again.
Another solution - remove folder
/data/data/xyz/
in some ways. May be you need root for this.Code from
PackageManager
(comments may be very helpfull):您的应用程序似乎使用本机代码。你用NDK吗?
一种检查方法是使用
“apktool dump badging ”
请参阅 http://ibotpeaches.github.io/Apktool/
寻找类似的内容
本机代码:'armeabi'
在输出中
Your application appears to use native code. Do you use NDK?
One way to check is to use
"apktool dump badging "
see http://ibotpeaches.github.io/Apktool/
Look for something like
native-code: 'armeabi'
in the output
当您签署 apk 时,您可能会执行 proguard 步骤,这会删除未引用的代码部分(类、方法、字段等),因此您会传递与缓冲区大小相关的错误。
但 proguard 可能并不是每次都能解决,你仍然有可能超出缓冲区大小限制。
Facebook对此有一个解决方案:“将我们的应用程序分成多个dex文件”。请参阅:https://www.facebook.com/notes/facebook-engineering/under-the-hood-dalvik-patch-for-facebook-for-android/10151345597798920
When you sign the apk, you probably execute proguard steps, which removes unreferenced code parts(classes, methods, fields etc.) So you pass that error related with the buffer size.
But proguard may not be a solution every time, you still have the possibility to exceed the buffer size limit.
Facebook has a solution for this: "Breaking our app into multiple dex files". See: https://www.facebook.com/notes/facebook-engineering/under-the-hood-dalvik-patch-for-facebook-for-android/10151345597798920