Anuken/Mindustry · error · IOException
Unknown save version: {}. Are you trying to load a save from
Error message
Unknown save version: {}. Are you trying to load a save from a newer version? What it means
Thrown by MapIO.createMap when reading a map file: after reading the save header and version int, SaveIO.getSaveWriter(version) returns null (no registered SaveVersion for that number). The map's save format version is unknown to this build, implying it was written by a newer (or unrecognized) version. This is the map-import variant of the save-version guard.
Source
Thrown at core/src/mindustry/io/MapIO.java:43
public static boolean isImage(Fi file){
try(InputStream stream = file.read(32)){
for(int i1 : pngHeader){
if(stream.read() != i1){
return false;
}
}
return true;
}catch(IOException e){
return false;
}
}
public static Map createMap(Fi file, boolean custom) throws IOException{
try(InputStream is = new InflaterInputStream(file.read(bufferSize)); CounterInputStream counter = new CounterInputStream(is); DataInputStream stream = new DataInputStream(counter)){
SaveIO.readHeader(stream);
int version = stream.readInt();
SaveVersion ver = SaveIO.getSaveWriter(version);
if(ver == null) throw new IOException("Unknown save version: " + version + ". Are you trying to load a save from a newer version?");
StringMap tags = new StringMap();
ver.readRegion("meta", stream, counter, in -> tags.putAll(ver.readStringMap(in)));
return new Map(file, tags.getInt("width"), tags.getInt("height"), tags, custom, version, Version.build);
}
}
public static void writeMap(Fi file, Map map) throws IOException{
writeMap(file, map, true);
}
/** @param embed if true, assets will be embedded in the map - this is needed for external export. */
public static void writeMap(Fi file, Map map, boolean embed) throws IOException{
try{
SaveIO.write(file, new SaveOptions(){{
extraTags = map.tags;
embedAssets = embed;
}});
}catch(Exception e){View on GitHub (pinned to f695ad7e60)
Solutions
- Update Mindustry to the build that authored the map.
- Re-export the map from a compatible version.
- Catch the IOException and inform the user the map version is unsupported.
Example fix
// before
Map map = MapIO.createMap(file, true);
// after
try{
Map map = MapIO.createMap(file, true);
}catch(IOException e){
ui.showErrorMessage("This map is from an unsupported save version.");
Log.err(e);
} Defensive patterns
Strategy: try-catch
Validate before calling
// sniff the save version before full parse if you can read the header
// (SaveIO.getSaveWriter(version) == null signals unknown version)
if(SaveIO.getSaveWriter(version) == null){
throw new IOException("Unsupported map save version: " + version);
} Try / catch
try{ Map map = MapIO.createMap(file, true); }catch(IOException e){ ui.showErrorMessage("Unsupported map version"); Log.err(e); } Prevention
- Keep the game updated to read newer map versions.
- Catch IOException at the import boundary.
- Maintain maps in a compatible version when sharing.
- Surface a clear 'newer version required' message to users.
When it happens
Trigger: Importing/loading a map (.msav used as a map) whose embedded save version is not registered in SaveIO. Called from the editor import path (createMap).
Common situations: Importing a map made in a newer Mindustry build; map file from a modded/fork build using a different version scheme; corrupted version field.
Related errors
- Unknown version: {ver} (are you trying to load a schematic f
- Error reading region "{}".
- Error reading region "{}": read length mismatch. Expected: {
- Error writing region "{}".
- Map has no cores!
AI-assisted analysis of Anuken/Mindustry@f695ad7e60 (2026-08-14).
Data as JSON: /api/errors/af4afcec304223b1.
Report an issue: GitHub.