android – 软件包xyz不匹配uid:10044在磁盘上,10045在设置中

前端之家收集整理的这篇文章主要介绍了android – 软件包xyz不匹配uid:10044在磁盘上,10045在设置中前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我找到了一个在VM( guide)中安装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

我在谷歌搜索错误,发现一个小的Python脚本来解决问题,但它不起作用(script).执行脚本后,我得到了同样的错误.

我使用Android-x86 2.2泛型,更多细节可以在这里找到:Release 2.2

有没有可能解决这个问题?

编辑:

我测试了所有2.2版本.只有泛型和sparta一般工作,但没有人接受我的apk.
尝试使用adb install< packagefile>太.

EDIT2:

我试过@Vlad的推荐工具.它在签署apk后部分工作.最后我使用apkTools并用apktool中的new替换了apkEdit的旧文件.
但是使用adb的安装会挂起等待设备的消息或什么都没有.如果我相信eclipse DDMS,每次我尝试安装apk时,与设备的连接都会丢失.
这是我尝试安装普通apk时的失败:失败[INSTALL_Failed_INVALID_APK]

解决方法

错误包xyz不匹配uid:磁盘上的10044,由存在的文件夹/ data / data / xyz /引起的设置中的10045.

在此消息文件夹中存在并且具有从现在开始安装的不同所有者(10044)(10045).它是由以前的不洁安装引起的.

例如,先前安装失败并出现一些错误,并且不删除创建的文件夹.

因为在文件夹中可以将来自其他app的数据安卓不能使用它. PackageManager尝试以不同的方式修复它,但如果不能这样做 – 它获取应用程序不同的目录并显示此消息.

更好的解决方案 – 安装应用程序并清除它.之后再安装一次.

另一种解决方案 – 在某些方面删除文件夹/ data / data / xyz /.可能你需要这个根.

来自PackageManager的代码(评论可能非常有用):

// This is a normal package,need to make its data directory.
        dataPath = getDataPathForPackage(pkg.packageName,0);

        boolean uidError = false;

        if (dataPath.exists()) {
            // XXX should really do this check for each user.
            mOutPermissions[1] = 0;
            FileUtils.getPermissions(dataPath.getPath(),mOutPermissions);

            // If we have mismatched owners for the data path,we have a problem.
            if (mOutPermissions[1] != pkg.applicationInfo.uid) {
                boolean recovered = false;
                if (mOutPermissions[1] == 0) {
                    // The directory somehow became owned by root.  Wow.
                    // This is probably because the system was stopped while
                    // installd was in the middle of messing with its libs
                    // directory.  Ask installd to fix that.
                    int ret = mInstaller.fixUid(pkgName,pkg.applicationInfo.uid,pkg.applicationInfo.uid);
                    if (ret >= 0) {
                        recovered = true;
                        String msg = "Package " + pkg.packageName
                                + " unexpectedly changed to uid 0; recovered to " +
                                + pkg.applicationInfo.uid;
                        reportSettingsProblem(Log.WARN,msg);
                    }
                }
                if (!recovered && ((parseFlags&PackageParser.PARSE_IS_SYSTEM) != 0
                        || (scanMode&SCAN_BOOTING) != 0)) {
                    // If this is a system app,we can at least delete its
                    // current data so the application will still work.
                    int ret = mInstaller.remove(pkgName,0);
                    if (ret >= 0) {
                        // TODO: Kill the processes first
                        // Remove the data directories for all users
                        sUserManager.removePackageForAllUsers(pkgName);
                        // Old data gone!
                        String prefix = (parseFlags&PackageParser.PARSE_IS_SYSTEM) != 0
                                ? "System package " : "Third party package ";
                        String msg = prefix + pkg.packageName
                                + " has changed from uid: "
                                + mOutPermissions[1] + " to "
                                + pkg.applicationInfo.uid + "; old data erased";
                        reportSettingsProblem(Log.WARN,msg);
                        recovered = true;

                        // And now re-install the app.
                        ret = mInstaller.install(pkgName,pkg.applicationInfo.uid);
                        if (ret == -1) {
                            // Ack should not happen!
                            msg = prefix + pkg.packageName
                                    + " could not have data directory re-created after delete.";
                            reportSettingsProblem(Log.WARN,msg);
                            mLastScanError = PackageManager.INSTALL_Failed_INSUFFICIENT_STORAGE;
                            return null;
                        }
                        // Create data directories for all users
                        sUserManager.installPackageForAllUsers(pkgName,pkg.applicationInfo.uid);
                    }
                    if (!recovered) {
                        mHassystemUIdErrors = true;
                    }
                } else if (!recovered) {
                    // If we allow this install to proceed,we will be broken.
                    // Abort,abort!
                    mLastScanError = PackageManager.INSTALL_Failed_UID_CHANGED;
                    return null;
                }
                if (!recovered) {
                    pkg.applicationInfo.dataDir = "/mismatched_uid/settings_"
                        + pkg.applicationInfo.uid + "/fs_"
                        + mOutPermissions[1];
                    pkg.applicationInfo.nativeLibraryDir = pkg.applicationInfo.dataDir;
                    String msg = "Package " + pkg.packageName
                            + " has mismatched uid: "
                            + mOutPermissions[1] + " on disk,"
                            + pkg.applicationInfo.uid + " in settings";
                    // writer
                    synchronized (mPackages) {
                        mSettings.mReadMessages.append(msg);
                        mSettings.mReadMessages.append('\n');
                        uidError = true;
                        if (!pkgSetting.uidError) {
                            reportSettingsProblem(Log.ERROR,msg);
                        }
                    }
                }
            }
            pkg.applicationInfo.dataDir = dataPath.getPath();

猜你在找的Android相关文章