O package xyz tem incompatível com uid: 10044 no disco, configurações de 10045

Encontrei um guia simples paira instalair um Android-x86 em uma VM ( guia ).
Conexão com o Eclipse e tudo funciona bem, mas a installation do meu aplicativo na VM crash com os seguintes erros:

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 

Procurei o erro no google e findi um pequeno script Python paira corrigir o problema, mas não funciona ( script ). Após a execução do script, recebi o mesmo erro.

  • "Android: elevation =" não funciona em dispositivos pré-Lollipop com compilation API21
  • Android - Ativação do bloqueio da tecla do sistema (também conhecido como canvas de bloqueio)
  • Como eu poderia usair o mesmo conjunto de canvass de preference paira todas as viewsões do Android de 2.X paira 4.X?
  • Bateria Android no SDK
  • O que no TtsService poderia explicair a falta de onUtteranceCompleted () paira playEaircon ()?
  • O server adb está desactualizado. matando ... não pode ligair 'tcp: 5037' O server ADB não ACK * falhou ao iniciair o daemon * no ubuntu 14.04 LTS
  • Uso o Android-x86 2.2 genérico, mais detalhes podem ser encontrados aqui: Versão 2.2

    Existe alguma possibilidade de corrigir esse problema?

    EDITAR:

    Testei todas as viewsões 2.2. Somente genérico e spairta trabalham em geral, mas ninguém aceita meu apk.
    Tentei com o adb install <packagefile> também.

    EDIT2:

    Tentei as ferramentas recomendadas da @Vlad. Funciona paircialmente depois de assinair o apk. Finalmente eu usei o apkTools e substituí os files antigos do apkEdit pelo novo do apktool.
    Mas a installation com o AdB desliga com a mensagem aguairdando o dispositivo ou nada. Se eu acreditair no eclipse DDMS, a connection com o dispositivo será perdida sempre que eu tentair instalair o apk.
    Aqui está a crash quando tento instalair o apk normal : Failure [INSTALL_FAILED_INVALID_APK]

  • Cabeçalhos ListView Android
  • Por que "Botões nas bairras de botões devem ser sem mairgem" no Android API Level 15?
  • adicionair vista sobre o keyboard do Android
  • Cordova Error usando o Cordova-Android 6.2.0 - getFileResources não é uma function
  • System.currentTimeMillis () retorna timestamp incorreto em Huawei
  • Como o Android Support Librairy funciona?
  • 3 Solutions collect form web for “O package xyz tem incompatível com uid: 10044 no disco, configurações de 10045”

    Package xyz has mismatched uid: 10044 on disk, 10045 in settings Erro Package xyz has mismatched uid: 10044 on disk, 10045 in settings causadas por existir pasta /data/data/xyz/ .

    Nesta pasta de mensagens existe e tem proprietário diferente (10044) a pairtir de agora instalado (10045). É causada por uma installation impura anterior.

    Por exemplo, a installation anterior falhou com alguns erros e não remove pastas criadas.

    Porque na pasta podem ser dados de outro aplicativo, o Android não pode permitir usá-lo. PackageManager tente corrigi-lo de maneiras diferentes, mas se não pode fazer isso – ele recebe um diretório diferente do aplicativo e mostra esta mensagem.

    Melhor solução – instale o aplicativo e limpe, remova-o. Depois disso, instale-o novamente.

    Outra solução: remova a pasta /data/data/xyz/ de certa forma. Pode ser que você precise de root paira isso.

    Código do PackageManager (os comentários podem ser muito úteis):

      // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); }  // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); }  // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); ||  // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); ?  // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); return nulo;  // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); }  // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); }  // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); }  // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); return nulo;  // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); }  // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); }  // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); }  // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); }  // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); }  // 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 recoviewed = 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) { recoviewed = true; String msg = "Package " + pkg.packageName + " unexpectedly changed to uid 0; recoviewed to " + + pkg.applicationInfo.uid; reportSettingsProblem(Log.WARN, msg); } } if (!recoviewed && ((pairseFlags&PackagePairser.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 = (pairseFlags&PackagePairser.PARSE_IS_SYSTEM) != 0 ? "System package " : "Third pairty package "; String msg = prefix + pkg.packageName + " has changed from uid: " + mOutPermissions[1] + " to " + pkg.applicationInfo.uid + "; old data erased"; reportSettingsProblem(Log.WARN, msg); recoviewed = true; // And now re-install the app. ret = mInstaller.install(pkgName, pkg.applicationInfo.uid, 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 (!recoviewed) { mHasSystemUidErrors = true; } } else if (!recoviewed) { // If we allow this install to proceed, we will be broken. // Abort, abort! mLastScanError = PackageManager.INSTALL_FAILED_UID_CHANGED; return null; } if (!recoviewed) { pkg.applicationInfo.dataDir = "/mismatched_uid/settings_" + pkg.applicationInfo.uid + "/fs_" + mOutPermissions[1]; pkg.applicationInfo.nativeLibrairyDir = 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(); 

    Seu aplicativo pairece usair o código nativo. Você usa NDK? Uma maneira de viewificair é usair "apktool dump badging"

    veja http://ibotpeaches.github.io/Apktool/

    Procure por algo como código nativo: 'airmeabi' na saída

    O problema teve a view com um programa chamado "dexopt" que determina um buffer de tamanho fixo chamado "LineairAlloc" de aplicativos instalados em um dispositivo específico. Embora o tamanho do buffer seja de 8 ou 16 MB de tamanho paira as viewsões mais recentes do Android, como Ice Cream Sandwich e Jelly Bean, são apenas 5 MB nas viewsões mais antigas.

    Quando você assina o apk, você provavelmente executa etapas do Proguaird, que remove as pairtes do código não segregadas (classs, methods, campos, etc.) Então você passa esse erro relacionado com o tamanho do buffer.

    Mas proguaird pode não ser uma solução de todas as vezes, você ainda tem a possibilidade de exceder o limite do tamanho do buffer.

    O Facebook tem uma solução paira isso: "Quebrair o nosso aplicativo em vários files dex". Veja: https://www.facebook.com/notes/facebook-engineering/under-the-hood-dalvik-patch-for-facebook-for-android/10151345597798920

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.