From 3c6009db345f5ae1aec7d4affb7e8cd30e4566cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sierpi=C5=84ski?= <33436839+sierpinskid@users.noreply.github.com> Date: Tue, 30 Jun 2026 13:07:19 +0200 Subject: [PATCH 1/2] Fix the input system dependency to work better across Unity versions from 2019.3 to Unity 6.x --- .../StreamChat/EditorTools/StreamEditorTools.cs | 11 +++++++++++ .../Scripts/Inputs/UnityPreviewInputSystem.cs | 1 + .../Scripts/StreamChat.SampleProject.asmdef | 11 +++-------- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Assets/Plugins/StreamChat/EditorTools/StreamEditorTools.cs b/Assets/Plugins/StreamChat/EditorTools/StreamEditorTools.cs index 23bbb282..a45299f1 100644 --- a/Assets/Plugins/StreamChat/EditorTools/StreamEditorTools.cs +++ b/Assets/Plugins/StreamChat/EditorTools/StreamEditorTools.cs @@ -55,8 +55,13 @@ public static void PrintAndroidExternalToolsInfo() $"{nameof(AndroidExternalToolsSettings.jdkRootPath)}: {AndroidExternalToolsSettings.jdkRootPath}"); sb.AppendLine( $"{nameof(AndroidExternalToolsSettings.ndkRootPath)}: {AndroidExternalToolsSettings.ndkRootPath}"); +#if UNITY_6000_0_OR_NEWER + sb.AppendLine( + $"GradlePath: {AndroidExternalToolsSettings.Gradle.path}"); +#else sb.AppendLine( $"{nameof(AndroidExternalToolsSettings.gradlePath)}: {AndroidExternalToolsSettings.gradlePath}"); +#endif Debug.Log(sb.ToString()); Application.Quit(0); #endif @@ -99,9 +104,15 @@ public static void SetAndroidExternalTools() if (!string.IsNullOrEmpty(androidExternalToolsSettings.GradlePath)) { +#if UNITY_6000_0_OR_NEWER + sb.AppendLine( + $"Setting GradlePath to: {androidExternalToolsSettings.GradlePath}"); + AndroidExternalToolsSettings.Gradle.path = androidExternalToolsSettings.GradlePath; +#else sb.AppendLine( $"Setting {nameof(AndroidExternalToolsSettings.gradlePath)} to: {androidExternalToolsSettings.GradlePath}"); AndroidExternalToolsSettings.gradlePath = androidExternalToolsSettings.GradlePath; +#endif } Debug.Log(sb.ToString()); diff --git a/Assets/Plugins/StreamChat/SampleProject/Scripts/Inputs/UnityPreviewInputSystem.cs b/Assets/Plugins/StreamChat/SampleProject/Scripts/Inputs/UnityPreviewInputSystem.cs index faa5f127..843ac152 100644 --- a/Assets/Plugins/StreamChat/SampleProject/Scripts/Inputs/UnityPreviewInputSystem.cs +++ b/Assets/Plugins/StreamChat/SampleProject/Scripts/Inputs/UnityPreviewInputSystem.cs @@ -1,5 +1,6 @@ #if ENABLE_INPUT_SYSTEM using System; +using UnityEngine; using UnityEngine.InputSystem; #endif diff --git a/Assets/Plugins/StreamChat/SampleProject/Scripts/StreamChat.SampleProject.asmdef b/Assets/Plugins/StreamChat/SampleProject/Scripts/StreamChat.SampleProject.asmdef index e34fcfc8..3cf5e363 100644 --- a/Assets/Plugins/StreamChat/SampleProject/Scripts/StreamChat.SampleProject.asmdef +++ b/Assets/Plugins/StreamChat/SampleProject/Scripts/StreamChat.SampleProject.asmdef @@ -4,7 +4,8 @@ "references": [ "StreamChat.Core", "Unity.TextMeshPro", - "StreamChat.Libs" + "StreamChat.Libs", + "Unity.InputSystem" ], "includePlatforms": [], "excludePlatforms": [], @@ -13,12 +14,6 @@ "precompiledReferences": [], "autoReferenced": false, "defineConstraints": [], - "versionDefines": [ - { - "name": "Select...", - "expression": "", - "define": "" - } - ], + "versionDefines": [], "noEngineReferences": false } \ No newline at end of file From eecbf6e51906bcd60f14c390b6d753cdc0a65d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sierpi=C5=84ski?= <33436839+sierpinskid@users.noreply.github.com> Date: Tue, 30 Jun 2026 13:40:59 +0200 Subject: [PATCH 2/2] Fix compiler error in Unity 2020 -> StreamApiException.cs(121,67): error CS1503: Argument 1: cannot convert from 'IReadOnlyDictionary' to 'IDictionary' --- .../Plugins/StreamChat/Core/Exceptions/StreamApiException.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Plugins/StreamChat/Core/Exceptions/StreamApiException.cs b/Assets/Plugins/StreamChat/Core/Exceptions/StreamApiException.cs index f021996f..41cb6068 100644 --- a/Assets/Plugins/StreamChat/Core/Exceptions/StreamApiException.cs +++ b/Assets/Plugins/StreamChat/Core/Exceptions/StreamApiException.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text; using StreamChat.Core.InternalDTO.Models; @@ -118,7 +119,7 @@ private StreamApiException( if (exceptionFields != null && exceptionFields.Count > 0) { - _exceptionFields = new Dictionary(exceptionFields); + _exceptionFields = exceptionFields.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); } }