InteractiveScapeGmbH / TuioUnityClient

MIT License
14 stars 2 forks source link

Unity build problem - Newtonsoft.Json #11

Closed av-pong closed 1 month ago

av-pong commented 1 month ago

I'm trying to get your plugin to work on my computer (Windows 10), but when I create an empty scene in Unity that contains a TUIO 2.0 or 1.0 session (connection type = websocket), the build fails with the following error:

on Unity 2023.1.0f1:

Building Library\Bee\artifacts\WinPlayerBuildProgram\ManagedStripped failed with output: C:\Program Files\Unity\Hub\Editor\2023.1.0f1\Editor\Data\il2cpp\build\deploy\UnityLinker.exe @Library\Bee\artifacts\rsp\1387182138735316738.rsp Fatal error in Unity CIL Linker Mono.Linker.LinkerFatalErrorException: ILLink: error IL1010: Assembly 'InteractiveScape.Tuio, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' cannot be loaded due to failure in processing 'SxmMqttBridge, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' reference ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' at Unity.Linker.UnityAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters) at Unity.IL2CPP.Common.AssemblyDependenciesComponent.CollectAssemblyDependencies(AssemblyDefinition assembly, Boolean throwOnUnresolved) at Unity.IL2CPP.Common.AssemblyDependenciesComponent.GetReferencedAssembliesFor(AssemblyDefinition assembly) at Unity.Linker.UnityLinkContext.ResolveReferences(AssemblyDefinition assembly) at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences(AssemblyDefinition assembly) at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences(AssemblyDefinition assembly) --- End of inner exception stack trace --- at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences(AssemblyDefinition assembly) at Mono.Linker.Steps.BaseStep.Process(LinkContext context) at Unity.Linker.UnityPipeline.ProcessStep(LinkContext context, IStep step) at Mono.Linker.Pipeline.Process(LinkContext context) at Unity.Linker.UnityDriver.UnityRun(UnityLinkContext context, UnityPipeline p, LinkRequest linkerOptions, TinyProfiler2 tinyProfiler, ILogger customLogger) at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling(TinyProfiler2 tinyProfiler, ILogger customLogger) at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling() at Unity.Linker.UnityDriver.RunDriver()

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

on Unity 2022.3.34f1

ArgumentException: The Assembly Newtonsoft.Json is referenced by SxmMqttBridge ('Packages/com.interactive-scape.tuio_client/lib/SxmMqttBridge/SxmMqttBridge.dll'). But the dll is not allowed to be included or could not be found. UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2[TKey,TValue] cache, UnityEditor.BuildTarget target, UnityEditor.ScriptingImplementation scriptingImplementation) (at <9ebc778a6d634deab4b52bba4afceb9f>:0) UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2[TKey,TValue] cache, UnityEditor.BuildTarget target, UnityEditor.ScriptingImplementation scriptingImplementation) (at <9ebc778a6d634deab4b52bba4afceb9f>:0) UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, UnityEditor.BuildTarget target, UnityEditor.ScriptingImplementation scriptingImplementation) (at <9ebc778a6d634deab4b52bba4afceb9f>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

How can I fix the problem preferably in Unity 2023?

eqbic commented 1 month ago

it seems it can not find the dll file for newtonsoft json. I could reproduce the issue on my system. I uploaded an update with attached .dll file for newtonsoft and it fixed the build issue for me. could you update your package and test it? thanks

av-pong commented 1 month ago

It's worked out! Thanks for the quick reply.