Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

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

Discussion in 'Input System' started by Francoimora, Mar 25, 2023.

  1. Francoimora

    Francoimora

    Joined:
    Aug 1, 2013
    Posts:
    70
    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 https://forum.unity.com/threads/stack-overflow-on-build-due-to-input-system-1-5-0.1404538/). 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.
     
  2. Francoimora

    Francoimora

    Joined:
    Aug 1, 2013
    Posts:
    70
    UPDATE : It only happens on my computer and builds made by other computers run just fine on the haunted one.
     
  3. Francoimora

    Francoimora

    Joined:
    Aug 1, 2013
    Posts:
    70
    I REALLY need help on this as I can't even work anymore.
     
  4. jacobdavis1

    jacobdavis1

    Joined:
    Jun 29, 2021
    Posts:
    1
    Sorry Franco, I get the same issue in 1.5.1 and 1.4.4 as well.
     
  5. Francoimora

    Francoimora

    Joined:
    Aug 1, 2013
    Posts:
    70
    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 ?
     
  6. Francoimora

    Francoimora

    Joined:
    Aug 1, 2013
    Posts:
    70
  7. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,078
    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!
     
  8. jonkelling

    jonkelling

    Joined:
    Dec 18, 2019
    Posts:
    23
    I just started getting this with 1.4.4. Only on one computer.
     
  9. zjf000123

    zjf000123

    Joined:
    May 7, 2023
    Posts:
    3
    Right click the InputActionAsset and select "reimport", i fix the problem by doing this.