{"record":{"id":"a809e24027d40722","repo":"MuntashirAkon/AppManager","slug":"could-not-mount-moptions-uri","errorCode":null,"errorMessage":"Could not mount ${mOptions.uri}","messagePattern":"Could not mount (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/fm/FmViewModel.java","lineNumber":577,"sourceCode":"        VirtualFileSystem fs = VirtualFileSystem.getFileSystem(mOptions.uri);\n        if (fs == null) {\n            // TODO: 31/5/23 Handle read-only\n            Path filePath = Paths.getStrict(mOptions.uri);\n            Path cachedPath = Paths.get(mFileCache.getCachedFile(filePath));\n            String type = cachedPath.getType();\n            int vfsId;\n            if (ContentType.APK.getMimeType().equals(type)) {\n                vfsId = VirtualFileSystem.mount(filePath.getUri(), cachedPath, ContentType.APK.getMimeType());\n            } else if (FileUtils.isZip(cachedPath)) {\n                vfsId = VirtualFileSystem.mount(filePath.getUri(), cachedPath, ContentType.ZIP.getMimeType());\n            } else if (DexUtils.isDex(cachedPath)) {\n                vfsId = VirtualFileSystem.mount(filePath.getUri(), cachedPath, ContentType2.DEX.getMimeType());\n            } else {\n                vfsId = VirtualFileSystem.mount(filePath.getUri(), cachedPath, cachedPath.getType());\n            }\n            fs = VirtualFileSystem.getFileSystem(vfsId);\n            if (fs == null) {\n                throw new IOException(\"Could not mount \" + mOptions.uri);\n            }\n        }\n        return fs;\n    }\n}\n","sourceCodeStart":559,"sourceCodeEnd":583,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/fm/FmViewModel.java#L559-L583","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Retry opening the file after confirming it exists and is fully downloaded/readable at the given URI","Check logcat for the underlying VirtualFileSystem.mount() failure cause and fix that (permissions, storage space, provider)","Try re-copying the file to local storage and open from there; report as a bug if mount consistently fails for a valid file"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!filePath.exists() || filePath.length() == 0) {\n    throw new IOException(\"File missing or empty: \" + filePath);\n}","typeGuard":null,"tryCatchPattern":"try {\n    fs = getFileSystem();\n} catch (IOException e) {\n    showError(R.string.mount_failed);\n    Log.e(TAG, \"VFS mount failed for \" + uri, e);\n}","preventionTips":["Verify the file is fully downloaded and readable before mounting","Check the content type is one the VFS supports (APK/DEX/zip)","Monitor logcat for the root mount failure and surface it to the user"],"tags":["java","android","filesystem","vfs"],"backgroundTag":"file-open-failed","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"}