ArgumentException: The Path do not have a valid format

Create issue
Issue #54 new
Former user created an issue

This error came up when I tried to import the tilemap with the import as static tilemap. I am running Unity 5.1 and the error also didn't link to any script. It also prevented the map from importing. Earlier I had update the scripts to the 5.1 API using the built in unity asset updater. Here is the full error message:

ArgumentException: The Path do not have a valid format
System.IO.Directory.GetParent (System.String path) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/Directory.cs:365)
X_UniTMX.TileSet..ctor (TObject.Shared.NanoXMLNode node, System.String mapPath, X_UniTMX.Map map, Boolean isUsingStreamingPath, System.Action`1 onFinishedLoadingTileSet, Int32 firstID) (at Assets/X-UniTMX/Code/TileSet.cs:228)
X_UniTMX.Map.Initialize (TObject.Shared.NanoXMLDocument document) (at Assets/X-UniTMX/Code/Map.cs:748)
X_UniTMX.Map..ctor (UnityEngine.TextAsset mapText, System.String mapPath, UnityEngine.GameObject parent, UnityEngine.Material baseTileMaterial, Int32 sortingOrder, System.Boolean[] makeUnique, System.Action`1 onMapFinishedLoading, Int32 tileObjectEllipsePrecision, Boolean simpleTileObjectCalculation, Double clipperArcTolerance, Double clipperMiterLimit, JoinType clipperJoinType, EndType clipperEndType, Single clipperDeltaOffset) (at Assets/X-UniTMX/Code/Map.cs:440)
X_UniTMX.TiledMapComponent.LoadMap () (at Assets/X-UniTMX/Code/TiledMapComponent.cs:114)
X_UniTMX.TiledMapComponent.Initialize () (at Assets/X-UniTMX/Code/TiledMapComponent.cs:94)
X_UniTMX.TiledMapComponentEditor.DoImportMapButtonGUI () (at Assets/X-UniTMX/Editor/TiledMapComponentEditor.cs:129)
X_UniTMX.TiledMapComponentEditor.OnInspectorGUI () (at Assets/X-UniTMX/Editor/TiledMapComponentEditor.cs:575)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1150)

Comments (5)

  1. Guilherme Augusto Almeida Filo Maia repo owner

    Have you tried to use the trunkDev branch?

    The Unity2D branch is outdated, I'll update it when I fix the issues with sorting order, missing hexagonal objects support and the other reported bugs. This might take some time, but the trunkDev is working in Unity 5+ and is stable enough to be used.

  2. Jean-Philippe Rivard

    Yes I did. However I discovered the problem.

    As I was trying out your plugin in a brand new project, the XML and Tileset files were directly in the Resource folder. However, X-UniTMX doesn't like that as the path is empty. By creating a new Maps folder and moving my TMX file inside, the error was change.

    At that moment, the error was about the relative path in the XML file linking to the Tileset being wrong. I moved the Tileset into the Map folder and everything worked.

  3. Guilherme Augusto Almeida Filo Maia repo owner

    If I understood correctly, the error was the incorrect path for the TileSet inside the XML?

    It should work even at the root of the Resources folder, if it didn't, even with correct paths in the XML, then this is a bug...

  4. Jean-Philippe Rivard

    I'm sorry I wasn't clear enough.

    There was two problems. But that error, I got it specifically when both the tileset and the xml file were in the Resources Folder and not a folder within it.

  5. Log in to comment