skylot/jadx · critical · RuntimeException
Fallback parser failed to open file: {}
Error message
Fallback parser failed to open file: {} What it means
Thrown inside initFallbackParser() when constructing/opening the FallbackZipParser itself fails. Because the fallback parser is jadx's last resort (used when the custom parser cannot open the file), this error means neither parser could process the archive. The FallbackZipParser constructor throws FallbackException on open failure and open() throws FallbackException/IOException; both are caught and wrapped with the zip file path, chaining the cause.
Source
Thrown at jadx-commons/jadx-zip/src/main/java/jadx/zip/parser/JadxZipParser.java:379
}
@SuppressWarnings("resource")
private IZipEntry useFallbackParser(JadxZipEntry entry) {
LOG.debug("useFallbackParser used for {}", entry);
IZipEntry zipEntry = initFallbackParser().searchEntry(entry.getName());
if (zipEntry == null) {
throw new RuntimeException("Fallback parser can't find entry: " + entry);
}
return zipEntry;
}
@SuppressWarnings("resource")
private synchronized ZipContent initFallbackParser() {
if (fallbackZipContent == null) {
try {
fallbackZipContent = new FallbackZipParser(zipFile, options).open();
} catch (Exception e) {
throw new RuntimeException("Fallback parser failed to open file: " + zipFile, e);
}
}
return fallbackZipContent;
}
private boolean isEncrypted(JadxZipEntry entry) {
int flags = readFlags(entry);
return (flags & 1) != 0;
}
private int readFlags(JadxZipEntry entry) {
ByteBuffer buf = getBuffer();
buf.position(entry.getEntryStart() + 6);
return readU2(buf);
}
static byte[] bufferToBytes(ByteBuffer buf, int start, int size) {
byte[] data = new byte[size];View on GitHub (pinned to e738a26571)
Solutions
- Verify the file is a real zip/APK (check magic bytes 'PK\x03\x04' or 'PK\x05\x06') before invoking jadx.
- Check getCause() (FallbackException) for the underlying reason.
- Ensure the file is not locked by another process and is fully written.
- If the file is legitimately a non-zip input, pass it via custom code loaders instead of as an input file.
Defensive patterns
Strategy: validation
Validate before calling
// Validate the file is a real, openable zip before invoking jadx.
if (!file.isFile()) throw new IOException("Not a file: " + file);
try (java.util.zip.ZipFile zf = new java.util.zip.ZipFile(file)) {
// opens successfully -> fallback parser should also open it
} catch (IOException e) {
throw new IOException("Unreadable zip, will fail fallback too: " + file, e);
} Try / catch
try {
fallback = new FallbackZipParser(file, options).open();
} catch (RuntimeException e) { // wraps FallbackException
LOG.error("Neither parser can open {}: {}", file, e.getCause());
throw e;
} Prevention
- Confirm the file is a genuine, complete zip before processing.
- Check getCause() (FallbackException) for the true open failure.
- Ensure the file is not locked by another process.
When it happens
Trigger: Any earlier code path that decides to use the fallback parser (initial open with FALLBACK_AS_DEFAULT, or recovery from a custom-parser failure) reaches initFallbackParser(), and new FallbackZipParser(zipFile, options).open() throws.
Common situations: A file that is not a valid zip at all (wrong magic bytes, truncated, zero-byte); a zip that triggers a bug in Java's built-in ZipFile; a file locked/exclusively held by another process; an archive whose central directory is so damaged that even Java's tolerant parser gives up.
Related errors
- Failed to read bytes for entry: {}
- Failed to open input stream for entry: {}
- Failed to open zip: {}, error: {}
- Failed to open zip file: ${file.getAbsolutePath()}
- {}
AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14).
Data as JSON: /api/errors/5fb1868ec35f41b5.
Report an issue: GitHub.