MuntashirAkon/AppManager · error · IOException

Could not mount

Error message

Could not mount ${mOptions.uri}

What it means

FmViewModel lazily mounts a file (e.g. APK/DEX) into the virtual filesystem via VirtualFileSystem.mount() and then fetches the mounted filesystem. If mount() succeeds but getFileSystem(vfsId) returns null, it throws IOException('Could not mount <uri>'), meaning the mount did not yield a usable filesystem for the requested URI.

Solutions

  1. Retry opening the file after confirming it exists and is fully downloaded/readable at the given URI
  2. Check logcat for the underlying VirtualFileSystem.mount() failure cause and fix that (permissions, storage space, provider)
  3. Try re-copying the file to local storage and open from there; report as a bug if mount consistently fails for a valid file
Defensive patterns

Strategy: try-catch

Validate before calling

if (!filePath.exists() || filePath.length() == 0) {
    throw new IOException("File missing or empty: " + filePath);
}

Try / catch

try {
    fs = getFileSystem();
} catch (IOException e) {
    showError(R.string.mount_failed);
    Log.e(TAG, "VFS mount failed for " + uri, e);
}

Prevention

When it happens

Trigger: Opening a file in the file manager whose URI cannot be backed by a mounted VFS — mount returned an id but no filesystem is registered, e.g. unsupported/unsupported-by-provider content, corrupted archive, or failed internal registration.

Common situations: Opening a damaged or partially downloaded APK/zip; storage provider returning an unreadable file; cache path creation failing silently; attempting to mount a file type the VFS layer can't handle.

Understand the failure class

Background: "open() failed", "failed to open file", "cannot create file" — what a file open error means and how to fix it — this error's family across 42 libraries.

Related errors


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

Appendix: source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/fm/FmViewModel.java:577

        VirtualFileSystem fs = VirtualFileSystem.getFileSystem(mOptions.uri);
        if (fs == null) {
            // TODO: 31/5/23 Handle read-only
            Path filePath = Paths.getStrict(mOptions.uri);
            Path cachedPath = Paths.get(mFileCache.getCachedFile(filePath));
            String type = cachedPath.getType();
            int vfsId;
            if (ContentType.APK.getMimeType().equals(type)) {
                vfsId = VirtualFileSystem.mount(filePath.getUri(), cachedPath, ContentType.APK.getMimeType());
            } else if (FileUtils.isZip(cachedPath)) {
                vfsId = VirtualFileSystem.mount(filePath.getUri(), cachedPath, ContentType.ZIP.getMimeType());
            } else if (DexUtils.isDex(cachedPath)) {
                vfsId = VirtualFileSystem.mount(filePath.getUri(), cachedPath, ContentType2.DEX.getMimeType());
            } else {
                vfsId = VirtualFileSystem.mount(filePath.getUri(), cachedPath, cachedPath.getType());
            }
            fs = VirtualFileSystem.getFileSystem(vfsId);
            if (fs == null) {
                throw new IOException("Could not mount " + mOptions.uri);
            }
        }
        return fs;
    }
}

View on GitHub (pinned to 0152f468fc)