InvalidOperationException: Failed to add object of type `InputActionAsset`.

Hi,

I can’t use the Input System anymore. If I use the input system 1.5.0, it works in editor but not in build (see Stack Overflow on build due to Input System 1.5.0 ). If I use the input system 1.5.1, I have an error when trying to create a new input actions asset in editor :

InvalidOperationException: Failed to add object of type InputActionAsset. Check that the definition is in a file of the same name and that it compiles properly.
UnityEngine.InputSystem.Editor.InputActionImporter.OnImportAsset (UnityEditor.AssetImporters.AssetImportContext ctx) (at ./Library/PackageCache/com.unity.inputsystem@1.5.1/InputSystem/Editor/AssetImporter/InputActionImporter.cs:95)
UnityEditor.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.AssetImporters.AssetImportContext ctx) (at <3d77f9e52a364b2f825fba70966192a5>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

It makes my input actions assets unusuable so I can’t use it anymore (reimporting the asset triggers the errors everytime).

It happens even when creating an empty URP 3D projet (with adding just the input system). I’m using Unity 2022.2.8f1 on a Windows computer. I don’t have this problem on my Mac M1 Max computer.

UPDATE : It only happens on my computer and builds made by other computers run just fine on the haunted one.

I REALLY need help on this as I can’t even work anymore.

Sorry Franco, I get the same issue in 1.5.1 and 1.4.4 as well.

What kind of computer do you have ? Mine is a desktop Ryzen 9 3900X, Nvidia 2080 Super, Windows 11 Pro. Do you have the same problem on empty projects as well ?

?

Hello, I can not repdocue this issue locally using the same Unity version and the steps you provided.
Could you be so kind to submit a bug report through the editor after you reproduce the issue? This way we get the logs and the project and maybe that helps with getting to the bottom of this.
Please ping the case numer you get from Jira here.
Thank you!

I just started getting this with 1.4.4. Only on one computer.

Right click the InputActionAsset and select “reimport”, i fix the problem by doing this.

1 Like