MuntashirAkon/AppManager · error · BackupException
Could not get external data backup.
Error message
Could not get external data backup.
What it means
backupData() also collects the external data archive from the EXTERNAL_FILES subdirectory when the destination flags request external data backup. If that file cannot be found, the FileNotFoundException is wrapped into this BackupException: external-data backup was requested but the corresponding zip is absent from the external-files folder.
Solutions
- Place the external data zip inside the backup's external-files subdirectory (EXTERNAL_FILES) with the correct name.
- Re-create the OAndBackup backup with external data included before converting.
- If no external data exists, disable the external-data flag on the destination metadata so the lookup is skipped.
- Verify the external-files directory name matches EXTERNAL_FILES exactly and the zip name/crypto transform matches mSourceCryptoMode.
Example fix
// before: backup/external_files/ missing entirely while external data flag is set // after: // backup/external_files/com.example.app.zip // or unset the external-data flag: // metadataV2.flags.removeFlag(BackupFlags.BACKUP_EXT_DATA);
Defensive patterns
Strategy: validation
Validate before calling
String extZip = CryptoUtils.getAppropriateFilename(packageName + ".zip", sourceCryptoMode);
if (destFlags.backupExternalData()) {
if (!backupLocation.hasFile(EXTERNAL_FILES)
|| !backupLocation.findFile(EXTERNAL_FILES).hasFile(extZip)) {
throw new IllegalStateException("External data zip missing: " + EXTERNAL_FILES + "/" + extZip);
}
} Try / catch
try {
converter.convert(...);
} catch (BackupException e) {
if (e.getMessage().contains("external data backup")) {
Log.e(TAG, "external_files/<pkg>.zip not found; adjust flags or restore file", e.getCause());
}
} Prevention
- Verify the external-files subdirectory exists and is named exactly as EXTERNAL_FILES expects.
- Only enable the external-data flag when the source backup actually contains external data.
- Keep the external zip's crypto-transformed name in sync with the source crypto mode.
When it happens
Trigger: backupData() executes mBackupLocation.findFile(EXTERNAL_FILES).findFile(CryptoUtils.getAppropriateFilename(mPackageName + ".zip", mSourceCryptoMode)) and throws FileNotFoundException at OABConverter.java:312, with mDestMetadata.info.flags.backupExternalData() true.
Common situations: Source backup never included external data (app had none or OAndBackup backed up internal only); the external_files directory is missing or named differently; zip deleted during cleanup; crypto-mode mismatch producing a wrong expected filename.
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
- Could not get backup files.
- Could not get base.apk file.
- Could not get data file
- Could not get data files
- Could not get internal data backup.
AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12).
Data as JSON: /api/errors/a720432573fb0470.
Report an issue: GitHub.
Appendix: source
Thrown at app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/OABConverter.java:312
}
}
private void backupData() throws BackupException {
List<Path> dataFiles = new ArrayList<>(2);
if (mDestMetadata.info.flags.backupInternalData()) {
try {
dataFiles.add(mBackupLocation.findFile(CryptoUtils.getAppropriateFilename(mPackageName + ".zip",
mSourceCryptoMode)));
} catch (FileNotFoundException e) {
throw new BackupException("Could not get internal data backup.", e);
}
}
if (mDestMetadata.info.flags.backupExternalData()) {
try {
dataFiles.add(mBackupLocation.findFile(EXTERNAL_FILES).findFile(CryptoUtils.getAppropriateFilename(
mPackageName + ".zip", mSourceCryptoMode)));
} catch (FileNotFoundException e) {
throw new BackupException("Could not get external data backup.", e);
}
}
String tarType = mDestMetadata.info.tarType;
int i = 0;
Path[] files;
for (Path dataFile : dataFiles) {
files = new Path[]{dataFile};
// Decrypt APK file if needed
try {
files = ConvertUtils.decryptSourceFiles(files, mSourceCrypto, mSourceCryptoMode, mBackupItem);
} catch (IOException e) {
throw new BackupException("Failed to decrypt " + Arrays.toString(files), e);
}
// baseApkFiles should be a singleton array
if (files.length != 1) {
throw new BackupException("Incorrect number of APK files: " + files.length);
}
String dataBackupFilePrefix = BackupUtils.getDataFilePrefix(i++, getExt(tarType));View on GitHub (pinned to 0152f468fc)