MuntashirAkon/AppManager · error · BackupException

Could not get backup files.

Error message

Could not get backup files.

What it means

SBConverter.convert throws BackupException('Could not get backup files.') when BackupItems.createBackupItemGracefully throws IOException, i.e. the destination backup directory/files for the 'SB'-converted package could not be created or opened. Without a BackupItem the whole conversion cannot proceed.

Source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/SBConverter.java:104

        mUserId = UserHandleHidden.myUserId();
        mPm = ContextUtils.getContext().getPackageManager();
        mFilesToBeDeleted.add(xmlFile);
    }

    @Override
    public String getPackageName() {
        return mPackageName;
    }

    @Override
    public void convert() throws BackupException {
        // Source metadata
        BackupMetadataV2 sourceMetadata = generateMetadata();
        // Simulate a backup creation
        try {
            mBackupItem = BackupItems.createBackupItemGracefully(mUserId, "SB", mPackageName);
        } catch (IOException e) {
            throw new BackupException("Could not get backup files.", e);
        }
        boolean backupSuccess = false;
        try {
            try {
                // Destination metadata
                mDestMetadata = ConvertUtils.getV5Metadata(sourceMetadata, mBackupItem);
            } catch (CryptoException e) {
                throw new BackupException("Failed to get crypto " + mDestMetadata.info.crypto, e);
            }
            try {
                mChecksum = mBackupItem.getChecksum();
            } catch (IOException e) {
                throw new BackupException("Failed to create checksum file.", e);
            }
            // Backup icon
            backupIcon();
            if (mDestMetadata.info.flags.backupApkFiles()) {
                backupApkFile();

View on GitHub (pinned to 0152f468fc)

Solutions

  1. Check that the backup destination directory exists and is writable
  2. Ensure device storage has enough free space
  3. Verify the supplied userId and packageName form a valid path
  4. Inspect the wrapped IOException cause for the exact filesystem error
Defensive patterns

Strategy: try-catch

Validate before calling

File backupRoot = BackupUtils.getBackupDirectory(ContextUtils.getContext());
if (backupRoot == null || !backupRoot.canWrite() || backupRoot.getUsableSpace() < MIN_FREE_BYTES) {
    throw new IOException("Backup destination unavailable or full");
}

Try / catch

try {
    converter.convert(...);
} catch (BackupException e) {
    if ("Could not get backup files.".equals(e.getMessage())) {
        // check storage/permissions, then retry
    }
}

Prevention

When it happens

Trigger: createBackupItemGracefully fails because the backup location is unwritable, storage is full, the user id/package name yields an invalid path, or an I/O error occurs creating backup files.

Common situations: Tests or conversions running against read-only storage; external storage not mounted; conflicting permissions on the backup directory in Android scoped storage.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


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