{"record":{"id":"5ea89f8830a7a471","repo":"MuntashirAkon/AppManager","slug":"could-not-get-backup-files-oabconverter","errorCode":null,"errorMessage":"Could not get backup files.","messagePattern":"Could not get backup files\\.","errorType":"exception","errorClass":"BackupException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/OABConverter.java","lineNumber":117,"sourceCode":"    public OABConverter(@NonNull Path backupLocation) {\n        mBackupLocation = backupLocation;\n        // Last path component is the package name\n        mPackageName = backupLocation.getName();\n        mUserId = UserHandleHidden.myUserId();\n    }\n\n    @Override\n    public void convert() throws BackupException {\n        if (SPECIAL_BACKUPS.contains(mPackageName)) {\n            throw new BackupException(\"Cannot convert special backup \" + mPackageName);\n        }\n        // Source metadata\n        mSourceMetadata = readLogFile();\n        // Simulate a backup creation\n        try {\n            mBackupItem = BackupItems.createBackupItemGracefully(mUserId, \"OAndBackup\", mPackageName);\n        } catch (IOException e) {\n            throw new BackupException(\"Could not get backup files.\", e);\n        }\n        boolean backupSuccess = false;\n        try {\n            try {\n                // Destination metadata\n                mDestMetadata = ConvertUtils.getV5Metadata(mSourceMetadata, mBackupItem);\n            } catch (CryptoException e) {\n                throw new BackupException(\"Failed to get crypto \" + mDestMetadata.info.crypto, e);\n            }\n            try {\n                mChecksum = mBackupItem.getChecksum();\n            } catch (IOException e) {\n                throw new BackupException(\"Failed to create checksum file.\", e);\n            }\n            if (mDestMetadata.info.flags.backupApkFiles()) {\n                backupApkFile();\n            }\n            if (mDestMetadata.info.flags.backupData()) {","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/OABConverter.java#L99-L135","documentation":"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.\").","triggerScenarios":"createBackupItemGracefully(mUserId, \"OAndBackup\", mPackageName) throws IOException — typically because the backup directory cannot be located/created for the user, or storage is unavailable.","commonSituations":"Backup storage location not configured or unmounted (SD card removed); wrong userId passed; App Manager backup path missing; permission issues on external storage.","solutions":["Verify the backup storage location is set and accessible in App Manager settings","Ensure storage is mounted and writable for the given user ID","Check that the target backup directory can be created (permissions, SAF access)","Retry after granting storage/All-files-access permission to App Manager"],"exampleFix":"// before\nnew OABConverter(userId, pkg).convert(); // fails if storage not ready\n// after\nif (BackupUtils.getBackupDirectoryPath() != null && Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {\n    new OABConverter(userId, pkg).convert();\n}","handlingStrategy":"try-catch","validationCode":"String dir = BackupUtils.getBackupDirectoryPath();\nboolean ready = dir != null\n    && Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)\n    && new File(dir).canWrite();","typeGuard":null,"tryCatchPattern":"try {\n    converter.convert();\n} catch (BackupException e) {\n    if (\"Could not get backup files.\".equals(e.getMessage())) {\n        // prompt user to fix backup location / storage permissions, then retry\n    }\n}","preventionTips":["Configure and verify the backup storage location before converting","Ensure storage permissions (including All files access) are granted","Check SD card/removable storage is mounted","Test-write to the backup directory before large batch runs"],"tags":["backup","io","storage","migration"],"backgroundTag":"file-not-found","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}