iBotPeaches/Apktool · error · InFileNotFoundException
Input file (" + path + ") was not found or was not readable.
Error message
Input file (" + path + ") was not found or was not readable. What it means
InFileNotFoundException is thrown by ApkDecoder.decode() when the input APK is not a regular file or cannot be read (mApkFile.isFile() || canRead() checks fail). It is the decode-side guard that the input path exists and is readable before any unpacking happens. The path in the message is the absolute/normalized path of the File passed to the ApkDecoder constructor.
Source
Thrown at brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkDecoder.java:65
private final ExtFile mApkFile;
private final Config mConfig;
private final AtomicReference<AndrolibException> mFirstError;
private ApkInfo mApkInfo;
private SmaliDecoder mSmaliDecoder;
private ResDecoder mResDecoder;
private BackgroundWorker mWorker;
public ApkDecoder(File apkFile, Config config) {
mApkFile = new ExtFile(apkFile);
mConfig = config;
mFirstError = new AtomicReference<>();
}
public void decode(File outDir) throws AndrolibException {
if (!mApkFile.isFile() || !mApkFile.canRead()) {
throw new InFileNotFoundException(mApkFile.getPath());
}
// We don't follow symlinks here for safety reasons.
if (Files.exists(outDir.toPath(), LinkOption.NOFOLLOW_LINKS)) {
if (Files.isDirectory(outDir.toPath(), LinkOption.NOFOLLOW_LINKS)) {
if (!mConfig.isForced() && BrutIO.isNonEmptyDirectory(outDir)) {
throw new OutDirExistsException(outDir.getPath());
}
OS.rmdir(outDir);
} else {
if (!mConfig.isForced()) {
throw new OutDirExistsException(outDir.getPath());
}
OS.rmfile(outDir);
}
}
OS.mkdir(outDir);
if (mConfig.getJobs() > 1) {View on GitHub (pinned to 79b63384d7)
Solutions
- Verify the path exists and is a regular file: `ls -l <apk>` and correct typos.
- Fix permissions: `chmod +r <apk>` or run as a user that can read it.
- If using a symlink, make sure its target exists, or pass the real path.
Example fix
// before
new ApkDecoder(new File(args[0]), config).decode(outDir);
// after
File apk = new File(args[0]);
if (!apk.isFile() || !apk.canRead()) {
throw new IllegalArgumentException("Cannot read APK: " + apk.getAbsolutePath());
}
new ApkDecoder(apk, config).decode(outDir); Defensive patterns
Strategy: validation
Validate before calling
File apk = new File(path);
if (!apk.isFile() || !apk.canRead()) {
throw new IllegalArgumentException("APK missing or unreadable: " + apk.getAbsolutePath());
}
ApkDecoder decoder = new ApkDecoder(apk, config); Try / catch
try { decoder.decode(outDir); } catch (InFileNotFoundException e) { /* report path, check spelling/perms */ } Prevention
- Resolve and validate input paths with isFile()+canRead() before constructing ApkDecoder.
- Canonicalize user-supplied paths (getCanonicalPath) to surface symlink targets.
When it happens
Trigger: Calling `new ApkDecoder(new File(path), config).decode(outDir)` with a nonexistent path, a directory, a dangling symlink (isFile() is false), or a file without read permission for the current user.
Common situations: Typos in the APK path; running apktool d as a user without read access (permissions/ownership issues); passing a glob or URL instead of a local file; symlinked APK that points to a removed target.
Related errors
- Destination directory (" + path + ") already exists. Use -f
- Could not find framework resources for package ID {pkgId}. Y
- Could not generate:
- Could not load resources.arsc from file: {apkFile}
- Framework package not found: id=0x%02x
AI-assisted analysis of iBotPeaches/Apktool@79b63384d7 (2026-08-14).
Data as JSON: /api/errors/d1e94af49970f332.
Report an issue: GitHub.