skylot/jadx · error · JadxRuntimeException
Resource file save error
Error message
Resource file save error
What it means
ResourcesSaver.saveResourceFile copies a decoded resource stream to disk via Files.copy. If the copy fails (disk full, permission denied, path invalid), the partially written file is deleted and a JadxRuntimeException wraps the underlying cause.
Source
Thrown at jadx-core/src/main/java/jadx/core/xmlgen/ResourcesSaver.java:105
} catch (Exception e) {
LOG.warn("Resource '{}' not saved, got exception", rc.getName(), e);
}
return;
default:
LOG.warn("Resource '{}' not saved, unknown type", rc.getName());
break;
}
}
private void saveResourceFile(ResourceFile resFile, File outFile) throws JadxException {
ResourcesLoader.decodeStream(resFile, (size, is) -> {
Path target = outFile.toPath();
try {
Files.copy(is, target, StandardCopyOption.REPLACE_EXISTING);
} catch (Exception e) {
Files.deleteIfExists(target); // delete partially written file
throw new JadxRuntimeException("Resource file save error", e);
}
return null;
});
}
}
View on GitHub (pinned to e738a26571)
Solutions
- Check available disk space and free space if low
- Verify write permissions on the output directory
- Shorten the output path or move it closer to the filesystem root
- Temporarily disable antivirus or add an exclusion for the output dir
- Ensure the output directory exists and is writable before starting
Example fix
// Before decompiling, verify the output location:
Path out = Paths.get("/tmp/out");
Files.createDirectories(out);
if (!Files.isWritable(out)) {
throw new IllegalStateException("Output dir not writable: " + out);
} Defensive patterns
Strategy: try-catch
Validate before calling
// Verify output directory is writable with sufficient space
Path outDir = Paths.get(outputPath);
Files.createDirectories(outDir);
if (!Files.isWritable(outDir)) { throw new IOException("Output not writable"); }
if (outDir.toFile().getUsableSpace() < MIN_SPACE) { throw new IOException("Insufficient space"); } Try / catch
try {
decompiler.save();
} catch (JadxRuntimeException e) {
if (e.getMessage().contains("Resource file save error")) {
LOG.error("Failed to save a resource: " + e.getCause().getMessage(), e);
// continue — other resources may still save
}
} Prevention
- Check disk space and write permissions before starting decompilation
- Use short paths on Windows
- Temporarily disable antivirus for the output directory
- Catch JadxRuntimeException during save() to allow partial results
When it happens
Trigger: saveResourceFile calls ResourcesLoader.decodeStream, then Files.copy(is, target, REPLACE_EXISTING). On any exception, Files.deleteIfExists removes the partial output and rethrows as JadxRuntimeException. This is the terminal step of resource extraction during APK decompilation/saving.
Common situations: Insufficient disk space for the output directory. Read-only or permission-restricted output path. Path too long on Windows. Antivirus locking files mid-write. Output directory does not exist despite makeDirs being expected to create it.
Related errors
- Failed to reset code cache
- Failed to remove code cache for {}
- Failed to save temp file
- Failed to save mapping json
- Failed to create temp directory
AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14).
Data as JSON: /api/errors/a71ccacec69b3c6f.
Report an issue: GitHub.