MuntashirAkon/AppManager · error · BackupException

Could not get backup files.

Error message

Could not get backup files.

What it means

After reading the OAndBackup log file, the converter asks BackupItems.createBackupItemGracefully to stage a new App Manager backup item. If that staging throws IOException (backup location unresolvable or files inaccessible), it is rethrown as BackupException("Could not get backup files.").

Solutions

  1. Verify the backup storage location is set and accessible in App Manager settings
  2. Ensure storage is mounted and writable for the given user ID
  3. Check that the target backup directory can be created (permissions, SAF access)
  4. Retry after granting storage/All-files-access permission to App Manager

Example fix

// before
new OABConverter(userId, pkg).convert(); // fails if storage not ready
// after
if (BackupUtils.getBackupDirectoryPath() != null && Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
    new OABConverter(userId, pkg).convert();
}
Defensive patterns

Strategy: try-catch

Validate before calling

String dir = BackupUtils.getBackupDirectoryPath();
boolean ready = dir != null
    && Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)
    && new File(dir).canWrite();

Try / catch

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

Prevention

When it happens

Trigger: createBackupItemGracefully(mUserId, "OAndBackup", mPackageName) throws IOException — typically because the backup directory cannot be located/created for the user, or storage is unavailable.

Common situations: Backup storage location not configured or unmounted (SD card removed); wrong userId passed; App Manager backup path missing; permission issues on external storage.

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

Appendix: source

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

    public OABConverter(@NonNull Path backupLocation) {
        mBackupLocation = backupLocation;
        // Last path component is the package name
        mPackageName = backupLocation.getName();
        mUserId = UserHandleHidden.myUserId();
    }

    @Override
    public void convert() throws BackupException {
        if (SPECIAL_BACKUPS.contains(mPackageName)) {
            throw new BackupException("Cannot convert special backup " + mPackageName);
        }
        // Source metadata
        mSourceMetadata = readLogFile();
        // Simulate a backup creation
        try {
            mBackupItem = BackupItems.createBackupItemGracefully(mUserId, "OAndBackup", mPackageName);
        } catch (IOException e) {
            throw new BackupException("Could not get backup files.", e);
        }
        boolean backupSuccess = false;
        try {
            try {
                // Destination metadata
                mDestMetadata = ConvertUtils.getV5Metadata(mSourceMetadata, 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);
            }
            if (mDestMetadata.info.flags.backupApkFiles()) {
                backupApkFile();
            }
            if (mDestMetadata.info.flags.backupData()) {

View on GitHub (pinned to 0152f468fc)