Library/PackageCache/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs

I porting a game to vision pro . Game working at Editor .

I get this error when I take build

Library/PackageCache/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs(408,26): error CS1061: ‘InputAnalytics.IInputAnalytic’ does not contain a definition for ‘TryGatherData’ and no accessible extension method ‘TryGatherData’ accepting a first argument of type ‘InputAnalytics.IInputAnalytic’ could be found (are you missing a using directive or an assembly reference?)

Unity Version Version : 6000.0.19f1 preview
Input System Version : 1.10.0
Apple visionOS XR Plugin Version : 2.0.0-pre.11 ·
Renderer Pipeline : Built-in

1 Like

In Input System v1.11.0 there is a bug fix:

  • Fixed Package compilation when Unity Analytics module is not enabled on 2022.3. ISXB-996

Hi - sorry for the stupid question but how do i install the bug fix? i have clicked on both links but can’t see any options to update the package

I am currently using input system 1.11.2 having just upgraded from v2023 to v6 and get this error when i try to build the app (it works fine in editor - game mode
Library\PackageCache\com.unity.inputsystem\InputSystem\NativeInputRuntime.cs(411,26): error CS1061: ‘InputAnalytics.IInputAnalytic’ does not contain a definition for ‘TryGatherData’ and no accessible extension method ‘TryGatherData’ accepting a first argument of type ‘InputAnalytics.IInputAnalytic’ could be found (are you missing a using directive or an assembly reference?)

thanks

EDIT
I have just commented out

//if (analytic.TryGatherData(out var data, out var error))
            //    Analytics.Analytics.SendEvent(info.Name, data);
            //else
            //    Debug.Log(error);     // Non fatal

and getting past that error but no idea what i have switched off and if this is a terrible idea!

2 Likes

If you are using version 1.11.2 then you should have the bugfix. But since you are still seeing the issue, can you be so kind and report a bug via Editor > Help > Report bug and attach your project or a smaller test project that you can reproduce this with?

If commenting out this section is unblocking you then don’t worry, nothing bad happens when the analytics fail.

4 Likes

Unity 6000.0.28f1 (1.11.2). Bug is still there.
But I can confirm, commenting out the relevant lines solves the problem.

3 Likes

Same issue (Unity 6000.0.28f1 (1.11.2))

2 Likes

A quick look at the code shows that there is a lack of interface description. TryGatherData cannot be referenced in Unity2023_2 or later versions.

    internal static class InputAnalytics
    {
        public interface IInputAnalytic
#if UNITY_EDITOR && UNITY_2023_2_OR_NEWER
            : UnityEngine.Analytics.IAnalytic
#endif // UNITY_EDITOR && UNITY_2023_2_OR_NEWER
        {
            InputAnalyticInfo info { get; } // May be removed when only supporting 2023.2+ versions


#if !UNITY_2023_2_OR_NEWER
            bool TryGatherData(out IInputAnalyticData data, out Exception error);
#endif
        }

You can solve the problem by writing it like this:

    internal static class InputAnalytics
    {
        public interface IInputAnalytic
#if UNITY_EDITOR && UNITY_2023_2_OR_NEWER
            : UnityEngine.Analytics.IAnalytic
#endif // UNITY_EDITOR && UNITY_2023_2_OR_NEWER
        {
            InputAnalyticInfo info { get; } // May be removed when only supporting 2023.2+ versions


#if UNITY_EDITOR && UNITY_2023_2_OR_NEWER
            bool TryGatherData(out UnityEngine.Analytics.IAnalytic.IData data, out Exception error);
#else
            bool TryGatherData(out IInputAnalyticData data, out Exception error);
#endif
        }

I using Unity 6000.0.36f1 and inputsystem 1.12.0 my PC game not compiling. I trying 1 week but I cant solve problem. Please help anyone. When I click build button giving error.
Library\PackageCache\com.unity.inputsystem@920b46832575\InputSystem\NativeInputRuntime.cs(410,26): error CS1061: ‘InputAnalytics.IInputAnalytic’ does not contain a definition for ‘TryGatherData’ and no accessible extension method ‘TryGatherData’ accepting a first argument of type ‘InputAnalytics.IInputAnalytic’ could be found (are you missing a using directive or an assembly reference?)

I tryed ınputsystem 1.8.2 yes, not giving same error but not compile, givin this error.
Build completed with a result of ‘Failed’ in 2 seconds (1532 ms)
2 errors
UnityEditor.EditorApplication:Internal_CallDelayFunctions ()

Please help me, I must compile my project. I cant remove Input Functions :frowning:

Hi,

This sounds a lot like this issue Unity Issue Tracker - "error CS1061: 'InputAnalytics.IInputAnalytic' does not contain a definition for 'TryGatherData'" is thrown when rebuilding Addressable Assets Cache which was just fixed on Input System develop: FIX: Fixed an issue where compiling Addressables with Input System package present would result in failed compilation due to `IInputAnalytic.TryGatherData` not being defined. by ekcoh · Pull Request #2115 · Unity-Technologies/InputSystem · GitHub, could you confirm whether Input System develop fixes your issues, ie. clone Input System develop branch and add the package as a local package via package manager? This fix will be released with the next Input System release.

Hello Thank you for your answer, my English is not that good, as far as I understand you want me to download a package from the GitHub page you provided and install it manually, but I couldn’t see a download link on the page, I don’t know how to use GitHub anyway. If you give me a direct link, I can download it and try it right away. Please help me with this. I gave my game the feature of supporting XBox one, Logitec Extreme3d and Thrustmaster TCA Airbus controls. Normally, it works fine in Unity editor, but when I try to compile it, it gives an error. In some solutions here, there are people who wrote that if we download Input system 1.8.2, the problem will be solved. I tried that too, it compiled, but the joystick controls in the game worked incorrectly. For example, when I took off the helicopter, it started to go to the left by itself. So at least 1.8.2 compiles, but it was not a healthy solution for me. So I had to wait for the new version package. There is only 1 week left until my schedule to distribute the game and I am very worried.

Good day,

I had similar error when I was trying to build project on mobile platform(Unity 6000.0.31f, Input System 1.11.2 and 1.12.0) without enabled Analytics service. So, I’ve tried your suggestion for @idriscelik and downloaded Input Analytics package from git, “develop” branch and imported it as a local package. The package was recognized as Input System 1.13.0. After that I’ve successfully builded project.

Could you, please, provide, when official package 1.13.0 release will be? Thank you in advance.

To just verify if it resolves your issue, go to this URL: GitHub - Unity-Technologies/InputSystem: An efficient and versatile input system for Unity., click the green Code button, Download as ZIP. Unzip archive.
Go to Package Manager inside Unity, click the (+) menu button, Add Package from Disk… select the Packages/com.unity.inputsystem/package.json inside the unpacked zip. Package manager will then replace your Input System with a local copy reflecting this snapshot of develop (not an official release but it might help you determine if this is the associated issue since its fixed in this snapshot).

Thanks for the feedback and happy it helped you.

I will inform the team about this, but we do not have a set release date on 1.13.0 yet, since we want to include additionalfixes that are currently being worked on. Also note that what you downloaded is snapshot of current development version and not a formal release.

The particular fix is visible in this diff in case you want to patch locally for now: FIX: Fixed an issue where compiling Addressables with Input System package present would result in failed compilation due to `IInputAnalytic.TryGatherData` not being defined. by ekcoh · Pull Request #2115 · Unity-Technologies/InputSystem · GitHub, its 1 line of code (only line #50 needs to change).

1 Like

Hello
I did as you said, unity saw this package as input system 1.13.0. My game compiled successfully. As far as I can see, there seems to be no problem, but I will continue to test the game before publishing it. Do you think I should wait for the official 1.13.0 package or should I publish my game on steam like this?

From a risk mitigation perspective it would make sense to use the last released input system version (1.12.0) and only patch/fix this issue if it’s the only issue that affects you. I would not recommend using a develop snapshot (work in progress) in a release but that is totally up to you to decide. The motivation being that our official releases are subject for much more holistic quality assurance.

when will be the 1.13 release ?

1.13.0 version is now officially available. It won’t show up for all editor versions just yet in the package manager but you can add it manually via package manager or editing the package manifest.json file.

3 Likes

That is very good news. Thank you!