{"record":{"id":"91c21c71da931cec","repo":"MuntashirAkon/AppManager","slug":"filenotfoundexception","errorCode":null,"errorMessage":"FileNotFoundException","messagePattern":"FileNotFoundException","errorType":"exception","errorClass":"ApkFileException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/apk/ApkFile.java","lineNumber":266,"sourceCode":"                    unApkm.decryptFile(inputFD, outputStream);\n                }\n            } catch (IOException | RemoteException e) {\n                throw new ApkFileException(e);\n            }\n        } else {\n            // Open file descriptor if necessary\n            File cacheFilePath = null;\n            if (ContentResolver.SCHEME_FILE.equals(apkUri.getScheme())) {\n                // File scheme may not require an FD\n                cacheFilePath = new File(apkUri.getPath());\n            }\n            if (!FmProvider.AUTHORITY.equals(apkUri.getAuthority())) {\n                // Content scheme has a third-party authority\n                try {\n                    mFd = FileUtils.getFdFromUri(context, apkUri, \"r\");\n                    cacheFilePath = FileUtils.getFileFromFd(mFd);\n                } catch (FileNotFoundException e) {\n                    throw new ApkFileException(e);\n                } catch (SecurityException e) {\n                    Log.e(TAG, e);\n                }\n            }\n            if (cacheFilePath == null || !FileUtils.canReadUnprivileged(cacheFilePath)) {\n                // Cache manually\n                try {\n                    mCacheFilePath = mFileCache.getCachedFile(apkSource);\n                } catch (IOException | SecurityException e) {\n                    throw new ApkFileException(\"Could not cache the input file.\", e);\n                }\n            } else mCacheFilePath = cacheFilePath;\n        }\n        String packageName = null;\n        // Check for splits\n        if (extension.equals(\"apk\")) {\n            // Get manifest attributes\n            ByteBuffer manifest = getManifestFromApk(mCacheFilePath);","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/apk/ApkFile.java#L248-L284","documentation":"Thrown when FileUtils.getFdFromUri cannot open the content URI because the target file does not exist or the provider reports it missing; the FileNotFoundException is rewrapped as ApkFileException during ApkFile construction. Faulty input: apkUri pointing to a deleted/moved file or an unopenable provider entry.","triggerScenarios":"Thrown at app/src/main/java/io/github/muntashirakon/AppManager/apk/ApkFile.java:266 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the file/URI still exists before opening (it may have been deleted or moved)","Re-acquire the URI via the picker if the original grant/target is gone","Catch ApkFileException and inform the user the source package file is unavailable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}