MuntashirAkon/AppManager · error · BackupException

Destination doesn't contain any APK files.

Error message

Destination doesn't contain any APK files.

What it means

When the parsed backupMode is MODE_APK or MODE_BOTH, the converter expects the destination backup location to contain the APK file for the app (named via CryptoUtils.getAppropriateFilename of the apkName from the source log, honoring source crypto mode). If BackupLocation.hasFile() cannot find that file, the conversion cannot fulfill the APK part of the backup, so it throws. This keeps App Manager backups internally consistent: a backup flagged for APKs must actually contain them.

Source

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

            metadataV2.splitConfigs = ArrayUtils.emptyArray(String.class);
            metadataV2.hasRules = false;
            metadataV2.backupTime = jsonObject.getLong("lastBackupMillis");
            metadataV2.crypto = jsonObject.optBoolean("isEncrypted") ? CryptoUtils.MODE_OPEN_PGP : CryptoUtils.MODE_NO_ENCRYPTION;
            mSourceCryptoMode = metadataV2.crypto;
            mSourceCrypto = CryptoUtils.setupCrypto(metadataV2);
            metadataV2.apkName = new File(jsonObject.getString("sourceDir")).getName();
            // Flags
            metadataV2.flags = new BackupFlags(BackupFlags.BACKUP_MULTIPLE);
            int backupMode = jsonObject.optInt("backupMode", MODE_UNSET);
            if (backupMode == MODE_UNSET) {
                throw new BackupException("Destination doesn't contain any backup.");
            }
            if (backupMode == MODE_APK || backupMode == MODE_BOTH) {
                if (mBackupLocation.hasFile(CryptoUtils.getAppropriateFilename(metadataV2.apkName,
                        mSourceCryptoMode))) {
                    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);

View on GitHub (pinned to 0152f468fc)

Solutions

  1. Ensure the source backup directory contains the APK file whose name matches the "apkName" field in the log (e.g. base.apk).
  2. Re-run the OAndBackup backup in APK or Both mode so the APK is present before converting.
  3. If you only have a data backup, convert with backupMode set to MODE_DATA instead of MODE_APK/MODE_BOTH.
  4. Check for naming/crypto mismatch: if the source backup is encrypted, the file on disk has the crypto-transformed name; verify mSourceCryptoMode matches the actual files.

Example fix

// before: converting a data-only backup while log claims APK backup
// backupMode: 0 (MODE_APK) but directory only holds com.example.zip

// after: correct the mode in the log to match contents
// "backupMode": 1 (MODE_DATA) — or restore the missing base.apk into the backup dir
Defensive patterns

Strategy: validation

Validate before calling

String expectedApk = CryptoUtils.getAppropriateFilename(
        log.getString("apkName"), sourceCryptoMode);
if (!backupLocation.hasFile(expectedApk)) {
    throw new IllegalStateException("Missing APK in backup dir: " + expectedApk);
}

Try / catch

try {
    converter.convert(...);
} catch (BackupException e) {
    if (e.getMessage().contains("doesn't contain any APK files")) {
        Log.e(TAG, "Backup dir lacks the APK; check apkName and crypto mode", e);
    }
}

Prevention

When it happens

Trigger: In readLogFile(), backupMode == MODE_APK or MODE_BOTH, and mBackupLocation.hasFile(CryptoUtils.getAppropriateFilename(metadataV2.apkName, mSourceCryptoMode)) returns false at OABConverter.java:216 — the expected APK file (possibly encrypted-named) is absent from the backup directory.

Common situations: Data-only OAndBackup backups being converted as if they included APKs; the APK was deleted or cleaned from the backup folder; a mismatch between the apkName in the log and the actual file name on disk; crypto-mode mismatch so the expected (encrypted) file name differs from what's stored.

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/aafa8cc265970160. Report an issue: GitHub.