MuntashirAkon/AppManager · error · BackupException

Destination doesn't contain any data files.

Error message

Destination doesn't contain any data files.

What it means

When backupMode is MODE_DATA or MODE_BOTH, the converter looks for the app's data archive (packageName + ".zip", possibly with crypto-transformed name) both in the backup root and in the external-files subdirectory (EXTERNAL_FILES). If neither exists, no data backup can be produced, so it throws. This guards the invariant that a data-mode backup actually contains data files.

Source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/OABConverter.java:232

                    metadataV2.flags.addFlag(BackupFlags.BACKUP_APK_FILES);
                } else {
                    throw new BackupException("Destination doesn't contain any APK files.");
                }
            }
            if (backupMode == MODE_DATA || backupMode == MODE_BOTH) {
                boolean hasBackup = false;
                if (mBackupLocation.hasFile(CryptoUtils.getAppropriateFilename(mPackageName + ".zip",
                        mSourceCryptoMode))) {
                    metadataV2.flags.addFlag(BackupFlags.BACKUP_INT_DATA);
                    hasBackup = true;
                }
                if (mBackupLocation.hasFile(EXTERNAL_FILES) && mBackupLocation.findFile(EXTERNAL_FILES).hasFile(
                        CryptoUtils.getAppropriateFilename(mPackageName + ".zip", mSourceCryptoMode))) {
                    metadataV2.flags.addFlag(BackupFlags.BACKUP_EXT_DATA);
                    hasBackup = true;
                }
                if (!hasBackup) {
                    throw new BackupException("Destination doesn't contain any data files.");
                }
                metadataV2.flags.addFlag(BackupFlags.BACKUP_CACHE);
            }
            metadataV2.userId = UserHandleHidden.myUserId();
            metadataV2.dataDirs = ConvertUtils.getDataDirs(mPackageName, mUserId, metadataV2.flags
                    .backupInternalData(), metadataV2.flags.backupExternalData(), false);
            metadataV2.tarType = Prefs.BackupRestore.getCompressionMethod();
            metadataV2.keyStore = false;
            metadataV2.installer = Prefs.Installer.getInstallerPackageName();
            metadataV2.version = 2;  // Old version is used so that we know that it needs permission fixes
            return metadataV2;
        } catch (JSONException | IOException | CryptoException e) {
            return ExUtils.rethrowAsBackupException("Could not parse JSON file.", e);
        }
    }

    private void backupApkFile() throws BackupException {
        Path[] baseApkFiles;

View on GitHub (pinned to 0152f468fc)

Solutions

  1. Place the <packageName>.zip data archive in the backup root (or the external-files subfolder) before converting.
  2. Re-create the OAndBackup backup in Data or Both mode so the data zip is generated.
  3. If you only have the APK, set backupMode to MODE_APK in the log instead of MODE_DATA/MODE_BOTH.
  4. Verify the source crypto mode: an encrypted backup stores the zip under a transformed name; a wrong mSourceCryptoMode makes hasFile() miss it.

Example fix

// before: MODE_DATA requested, backup dir contains only base.apk
// after: either copy com.example.app.zip into the backup directory
//   backup/
//     base.apk
//     com.example.app.zip
// or set "backupMode": 0 (MODE_APK) in the log
Defensive patterns

Strategy: validation

Validate before calling

String zip = CryptoUtils.getAppropriateFilename(packageName + ".zip", sourceCryptoMode);
boolean hasData = backupLocation.hasFile(zip)
        || (backupLocation.hasFile(EXTERNAL_FILES)
            && backupLocation.findFile(EXTERNAL_FILES).hasFile(zip));
if (mode == MODE_DATA || mode == MODE_BOTH) {
    if (!hasData) throw new IllegalStateException("No data zip for " + packageName);
}

Try / catch

try {
    converter.convert(...);
} catch (BackupException e) {
    if (e.getMessage().contains("doesn't contain any data files")) {
        Log.e(TAG, "Data-mode conversion but no <pkg>.zip found", e);
    }
}

Prevention

When it happens

Trigger: In readLogFile(), backupMode == MODE_DATA or MODE_BOTH, and neither mBackupLocation.hasFile(<packageName>.zip, crypto-named) nor mBackupLocation.findFile(EXTERNAL_FILES).hasFile(<packageName>.zip) is true at OABConverter.java:232.

Common situations: APK-only OAndBackup backups being converted as data backups; the data zip was deleted or never created because the app had no backing-up-able data; the zip sits in an unexpected subdirectory the converter doesn't scan; encrypted filename mismatch due to wrong source crypto mode.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12). Data as JSON: /api/errors/c2cd7bc2ee72252d. Report an issue: GitHub.