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

  1. Check available disk space and free space if low
  2. Verify write permissions on the output directory
  3. Shorten the output path or move it closer to the filesystem root
  4. Temporarily disable antivirus or add an exclusion for the output dir
  5. 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

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


AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14). Data as JSON: /api/errors/a71ccacec69b3c6f. Report an issue: GitHub.