Is there a way to fix "ArgumentException: Unable to set invalid palette"

This comes up when i try to create a new tile palate, i am using the newest version of unity and i've check and everything is up to date. Here it the full thing:

ArgumentException: Unable to set invalid palette
UnityEditor.Tilemaps.GridPaintingState.set_palette (UnityEngine.GameObject value) (at ./Library/PackageCache/com.unity.2d.tilemap@1.0.0/Editor/GridPaintingState.cs:449)
UnityEditor.Tilemaps.GridPaletteAddPopup.OnGUI () (at ./Library/PackageCache/com.unity.2d.tilemap@1.0.0/Editor/GridPaletteAddPopup.cs:162)
UnityEditor.HostView.OldOnGUI () (at <9920ff0c944845d7b9f9a61ef1478edc>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.ProcessEvent (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <2a6c2bf2255f4beda040b401cc7fbbeb>:0)

I think they found a workaround in this post for the same error Question - Tile palette create error... - Unity Forum

they said "Then drag and drop the prefab into the tile palette window." but i dont know where abouts to drop it as it doesnt let me drop it into the tile palette window.

After you created your palette, manually add a sprite renderer component to it.

1 Like


Can confirm, this is the solution!

This error happens whenever you use an external drive.
This video demonstrates that you get the error ArgumentException: Unable to set invalid palette
whenever you use external drives. The issue goes away when you use the internal drive. Look right around the 1:45 mark

https://www.youtube.com/watch?v=Ic-Qg9BBIWI

I had this same problem, and I found the solution.

1st First solution: This probably happens because Unity is on an External HD. So, creating your project on a Local Disk, there will not be this problem.

2nd Second Solution

If by chance you want to keep your Project on your External HD. Just click on Save project when the error appears.

It worked for me. Just like that: The error message appears. You click on SAVE PROJECT. In the same test, the Bug fixes itself.

1 Like