M1 arm64架构的macos 加载了x86_64 架构的libkcp 引起不兼容问题
环境
Unity版本:Unity2021.3.16f1c1
平台:macos m1
使用节点:master@ec578e6 1月8号最后的提交
操作:服务端已经成功运行起来,客户端用的codeMode 为 Client 来 BuildModelAndHotfix,之后运行 Init场景,点击登录按钮 报错
System.TypeInitializationException: The type initializer for 'ET.KService' threw an exception. ---> System.DllNotFoundException: kcp assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) ET.Kcp.ikcp_setoutput(ET.KcpOutput)
at ET.Kcp.KcpSetoutput (ET.KcpOutput output) [0x00007] in /Users/huanfutech/Downloads/ET-master/Unity/Assets/Scripts/ThirdParty/Kcp/Kcp.cs:193
at ET.KService..cctor () [0x00001] in /Users/huanfutech/Downloads/ET-master/Unity/Assets/Scripts/Core/Module/Network/KService.cs:55
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
at ET.Client.NetClientComponentSystem+AwakeSystem.Awake (ET.Client.NetClientComponent self, System.Net.Sockets.AddressFamily addressFamily) [0x00001] in /Users/huanfutech/Downloads/ET-master/Unity/Assets/Scripts/Codes/Hotfix/Client/Module/Message/NetClientComponentSystem.cs:14
at ET.AwakeSystem\`2[T,A].ET.IAwakeSystem<A>.Run (ET.Entity o, A a) [0x00001] in /Users/huanfutech/Downloads/ET-master/Unity/Assets/Scripts/Core/Module/EventSystem/IAwakeSystem.cs:96
at ET.EventSystem.Awake[P1] (ET.Entity component, P1 p1) [0x0004f] in /Users/huanfutech/Downloads/ET-master/Unity/Assets/Scripts/Core/Module/EventSystem/EventSystem.cs:355
UnityEngine.Debug:LogError (object)
ET.UnityLogger:Error (string) (at <a href="Assets/Scripts/Loader/UnityLogger.cs" line="29">Assets/Scripts/Loader/UnityLogger.cs:29</a>)
ET.Logger:Error (System.Exception) (at <a href="Assets/Scripts/Core/Module/Log/Logger.cs" line="94">Assets/Scripts/Core/Module/Log/Logger.cs:94</a>)
ET.Log:Error (System.Exception) (at <a href="Assets/Scripts/Core/Module/Log/Log.cs" line="39">Assets/Scripts/Core/Module/Log/Log.cs:39</a>)
ET.EventSystem:Awake<System.Net.Sockets.AddressFamily> (ET.Entity,System.Net.Sockets.AddressFamily) (at <a href="Assets/Scripts/Core/Module/EventSystem/EventSystem.cs" line="359">Assets/Scripts/Core/Module/EventSystem/EventSystem.cs:359</a>)
ET.Entity:AddComponent<ET.Client.NetClientComponent, System.Net.Sockets.AddressFamily> (System.Net.Sockets.AddressFamily,bool) (at <a href="Assets/Scripts/Core/Module/Entity/Entity.cs" line="795">Assets/Scripts/Core/Module/Entity/Entity.cs:795</a>)
ET.Client.LoginHelper/<Login>d__0:MoveNext () (at <a href="Assets/Scripts/Codes/Hotfix/Client/Demo/Login/LoginHelper.cs" line="22">Assets/Scripts/Codes/Hotfix/Client/Demo/Login/LoginHelper.cs:22</a>)
ET.ETTask:SetResult () (at <a href="Assets/Scripts/ThirdParty/ETTask/ETTask.cs" line="145">Assets/Scripts/ThirdParty/ETTask/ETTask.cs:145</a>)
ET.ETAsyncTaskMethodBuilder:SetResult () (at <a href="Assets/Scripts/ThirdParty/ETTask/AsyncETTaskMethodBuilder.cs" line="35">Assets/Scripts/ThirdParty/ETTask/AsyncETTaskMethodBuilder.cs:35</a>)
ET.Client.RouterAddressComponentSystem/<Init>d__1:MoveNext () (at <a href="Assets/Scripts/Codes/Hotfix/Client/Demo/Router/RouterAddressComponentSystem.cs" line="24">Assets/Scripts/Codes/Hotfix/Client/Demo/Router/RouterAddressComponentSystem.cs:24</a>)
ET.ETTask:SetResult () (at <a href="Assets/Scripts/ThirdParty/ETTask/ETTask.cs" line="145">Assets/Scripts/ThirdParty/ETTask/ETTask.cs:145</a>)
ET.ETAsyncTaskMethodBuilder:SetResult () (at <a href="Assets/Scripts/ThirdParty/ETTask/AsyncETTaskMethodBuilder.cs" line="35">Assets/Scripts/ThirdParty/ETTask/AsyncETTaskMethodBuilder.cs:35</a>)
ET.Client.RouterAddressComponentSystem/<GetAllRouter>d__2:MoveNext () (at <a href="Assets/Scripts/Codes/Hotfix/Client/Demo/Router/RouterAddressComponentSystem.cs" line="40">Assets/Scripts/Codes/Hotfix/Client/Demo/Router/RouterAddressComponentSystem.cs:40</a>)
ET.ETTask\`1<string>:SetResult (string) (at <a href="Assets/Scripts/ThirdParty/ETTask/ETTask.cs" line="295">Assets/Scripts/ThirdParty/ETTask/ETTask.cs:295</a>)
ET.ETAsyncTaskMethodBuilder\`1<string>:SetResult (string) (at <a href="Assets/Scripts/ThirdParty/ETTask/AsyncETTaskMethodBuilder.cs" line="94">Assets/Scripts/ThirdParty/ETTask/AsyncETTaskMethodBuilder.cs:94</a>)
ET.Client.HttpClientHelper/<Get>d__0:MoveNext () (at <a href="Assets/Scripts/Codes/Hotfix/Client/Demo/Router/HttpClientHelper.cs" line="22">Assets/Scripts/Codes/Hotfix/Client/Demo/Router/HttpClientHelper.cs:22</a>)
System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation/<>c:<.cctor>b__7_0 (object)
ET.ThreadSynchronizationContext/<>c__DisplayClass3_0:<Post>b__0 () (at <a href="Assets/Scripts/Core/ThreadSynchronizationContext.cs" line="36">Assets/Scripts/Core/ThreadSynchronizationContext.cs:36</a>)
ET.ThreadSynchronizationContext:Update () (at <a href="Assets/Scripts/Core/ThreadSynchronizationContext.cs" line="25">Assets/Scripts/Core/ThreadSynchronizationContext.cs:25</a>)
ET.MainThreadSynchronizationContext:Update () (at <a href="Assets/Scripts/Core/Module/Synchronization/MainThreadSynchronizationContext.cs" line="18">Assets/Scripts/Core/Module/Synchronization/MainThreadSynchronizationContext.cs:18</a>)
ET.Game:Update () (at <a href="Assets/Scripts/Core/Singleton/Game.cs" line="82">Assets/Scripts/Core/Singleton/Game.cs:82</a>)
ET.Init:Update () (at <a href="Assets/Scripts/Loader/MonoBehaviour/Init.cs" line="42">Assets/Scripts/Loader/MonoBehaviour/Init.cs:42</a>)