MuntashirAkon/AppManager · error · BackupException

APK files backup is requested but no APK files have been bac

Error message

APK files backup is requested but no APK files have been backed up.

What it means

Thrown by SBConverter.backupApkFile when TarUtils.create fails to package the requested APK (and split config) files into the destination backup archive. The converter requested an APK backup but the tar creation step failed (any Throwable), so the archive could not be produced. It wraps the underlying cause, so inspect getCause() for the real I/O or crypto error.

Source

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

        Path sourceDir = mCachedApk.requireParent();
        // Get certificate checksums
        try {
            String[] checksums = ConvertUtils.getChecksumsFromApk(mCachedApk, mDestMetadata.info.checksumAlgo);
            for (int i = 0; i < checksums.length; ++i) {
                mChecksum.add(CERT_PREFIX + i, checksums[i]);
            }
        } catch (Exception ignore) {
        }
        // Backup APK files
        String[] apkFiles = ArrayUtils.appendElement(String.class, mDestMetadata.metadata.splitConfigs, mDestMetadata.metadata.apkName);
        String sourceBackupFilePrefix = BackupUtils.getSourceFilePrefix(getExt(mDestMetadata.info.tarType));
        Path[] sourceFiles;
        try {
            // We have to specify APK files because the folder may contain many
            sourceFiles = TarUtils.create(mDestMetadata.info.tarType, sourceDir, mBackupItem.getUnencryptedBackupPath(), sourceBackupFilePrefix,
                    apkFiles, null, null, false).toArray(new Path[0]);
        } catch (Throwable th) {
            throw new BackupException("APK files backup is requested but no APK files have been backed up.", th);
        }
        try {
            sourceFiles = mBackupItem.encrypt(sourceFiles);
        } catch (IOException e) {
            throw new BackupException("Failed to encrypt " + Arrays.toString(sourceFiles));
        }
        for (Path file : sourceFiles) {
            mChecksum.add(file.getName(), DigestUtils.getHexDigest(mDestMetadata.info.checksumAlgo, file));
        }
    }

    private void backupData() throws BackupException {
        List<Path> dataFiles = new ArrayList<>(3);
        try {
            if (mDestMetadata.info.flags.backupInternalData()) {
                dataFiles.add(getIntDataFile());
            }
            if (mDestMetadata.info.flags.backupExternalData()) {

View on GitHub (pinned to 0152f468fc)

Solutions

  1. Check the wrapped cause (BackupException.getCause()) to find the real TarUtils/I/O failure.
  2. Verify the cached APK and all split config files named in metadata.splitConfigs exist under the cache directory (mCachedApk.requireParent()).
  3. Confirm metadata.apkName matches the actual base APK file name; fix stale metadata if it was hand-edited.
  4. Re-extract the source backup archive to rule out corruption, then retry the conversion.
  5. If APK backup is not required, disable the APK flag so this step is skipped.

Example fix

// before: blindly convert with stale metadata
converter.convert();
// after: pre-check APK presence before converting
File base = new File(cacheDir, metadata.apkName);
if (!base.isFile()) {
    throw new IllegalStateException("base.apk missing: " + base);
}
for (String split : metadata.splitConfigs) {
    if (!new File(cacheDir, split).isFile()) {
        throw new IllegalStateException("missing split: " + split);
    }
}
converter.convert();
Defensive patterns

Strategy: validation

Validate before calling

String[] apkFiles = ArrayUtils.appendElement(String.class, metadata.splitConfigs, metadata.apkName);
for (String f : apkFiles) {
    if (f == null || !new File(cacheDir, f).isFile())
        throw new IllegalStateException("APK part missing from cache: " + f);
}

Try / catch

try { converter.convert(); }
catch (BackupException e) {
    if (e.getCause() != null) Log.e(TAG, "tar creation failed", e.getCause());
    // abort conversion, inform user which APK part is missing
}

Prevention

When it happens

Trigger: Calling convert() on a Swift Backup source with APK backup flag enabled when: the cached base.apk is missing or unreadable, splitConfigs in destination metadata reference files not present in sourceDir, TarUtils hits an I/O error writing the tar, or apkName/splitConfigs are null/empty so the filter matches nothing.

Common situations: Corrupted or partially-extracted source backup folder; converting a split-APK backup where split config names don't match the files on disk; read-only storage; mismatch between metadata apkName and actual cached file name after an AppManager version change.

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