Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac/iOS/Linux not supported in .NET 4.x (Unity 2019.2+) #3

Closed
dylanh724 opened this issue Jan 14, 2020 · 3 comments
Closed

Mac/iOS/Linux not supported in .NET 4.x (Unity 2019.2+) #3

dylanh724 opened this issue Jan 14, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@dylanh724
Copy link
Member

I don't know too much about this bug, as we don't support these platforms, but from what I can gather:

Mac/iOS/Linux builds with GameSparks Unity SDK do not support .NET 4.x (forced in Unity 2019.2+).

Windows seems fine. Mac and Linux works fine in Unity 2019.1: Seems like it's just 2019.2+ that has issues.

@dylanh724 dylanh724 added the enhancement New feature or request label Jan 14, 2020
@henriqueranj
Copy link

I had this issue when building for iOS - the app crashes when it starts the GameSparks initialization.

Here is the crash log:

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000101980178
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [491]
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   app-id-redacted                    	0x0000000101980178 il2cpp::icalls::mscorlib::System::Diagnostics::Debugger::Log(int, Il2CppString*, Il2CppString*) + 14090616 (Debugger.cpp:40)
1   app-id-redacted                    	0x0000000101fde930 GameSparksWebSocket_Open_m1979435849 + 20769072 (Bulk_GameSparks_0.cpp:15403)
2   app-id-redacted                    	0x0000000101fc3224 GSConnection_EnsureConnected_m1800406095 + 20656676 (Bulk_GameSparks.Api_0.cpp:0)
3   app-id-redacted                    	0x0000000101fc2fb4 GSConnection__ctor_m1485482396 + 20656052 (Bulk_GameSparks.Api_0.cpp:16712)
4   app-id-redacted                    	0x0000000101fc2344 GSInstance_Initialise_m1916099079 + 20652868 (Bulk_GameSparks.Api_0.cpp:19275)
5   app-id-redacted                    	0x0000000101d46330 PlatformBase_Start_m1280515149 + 18047792 (Bulk_Assembly-CSharp_5.cpp:32306)
6   app-id-redacted                    	0x0000000100dcdbd8 RuntimeInvoker_Void_t1185182177(void (*)(), MethodInfo const*, void*, void**) + 1825752 (Il2CppInvokerTable.cpp:81234)
7   app-id-redacted                    	0x00000001019c9e30 il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) + 14392880 (Runtime.cpp:499)
8   app-id-redacted                    	0x000000010133de00 scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool) + 7527936 (ScriptingApi_Il2Cpp.cpp:232)
9   app-id-redacted                    	0x00000001013452d0 ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 7557840 (ScriptingInvocation.cpp:341)
10  app-id-redacted                    	0x000000010134aa30 MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingExceptionPtr*) + 7580208 (MonoBehaviour.cpp:0)
11  app-id-redacted                    	0x000000010134ad40 MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethodPtr, ScriptingObjectPtr) + 7580992 (MonoBehaviour.cpp:889)
12  app-id-redacted                    	0x0000000101349d0c MonoBehaviour::DelayedStartCall(Object*, void*) + 7576844 (MonoBehaviour.cpp:1254)
13  app-id-redacted                    	0x00000001011d0f50 DelayedCallManager::Update(int) + 6033232 (CallDelayed.cpp:179)
14  app-id-redacted                    	0x0000000101285764 ExecutePlayerLoop(NativePlayerLoopSystem*) + 6772580 (PlayerLoop.cpp:337)
15  app-id-redacted                    	0x000000010128578c ExecutePlayerLoop(NativePlayerLoopSystem*) + 6772620 (PlayerLoop.cpp:354)
16  app-id-redacted                    	0x00000001012858e8 PlayerLoop() + 6772968 (PlayerLoop.cpp:408)
17  app-id-redacted                    	0x00000001010ad36c UnityPlayerLoopImpl(bool) + 4838252 (LibEntryPoint.mm:264)
18  app-id-redacted                    	0x0000000100c1f388 UnityRepaint + 62344 (UnityAppController+Rendering.mm:266)
19  app-id-redacted                    	0x0000000100c2f128 -[UnityAppController(ViewHandling) showGameUI] + 127272 (UnityAppController+ViewHandling.mm:212)
20  app-id-redacted                    	0x0000000100c2cbc8 -[UnityAppController startUnity:] + 117704 (UnityAppController.mm:134)
21  Foundation                    	0x00000001ef068420 0x1eef41000 + 1209376
22  CoreFoundation                	0x00000001ee559828 0x1ee4ad000 + 706600
23  CoreFoundation                	0x00000001ee559558 0x1ee4ad000 + 705880
24  CoreFoundation                	0x00000001ee558d8c 0x1ee4ad000 + 703884
25  CoreFoundation                	0x00000001ee553c68 0x1ee4ad000 + 683112
26  CoreFoundation                	0x00000001ee5531f0 0x1ee4ad000 + 680432
27  GraphicsServices              	0x00000001f07cc584 0x1f07c1000 + 46468
28  UIKitCore                     	0x000000021b49f4c0 0x21abb6000 + 9344192
29  app-id-redacted                    	0x0000000100c17ab0 main + 31408 (main.mm:33)
30  libdyld.dylib                 	0x00000001ee012bb4 0x1ee012000 + 2996

Back in the day, I managed to reproduce it with the following steps:

  • Create new Unity Project in 2018.1.8
  • Integrate latest GameSparks SDK
  • Configure the project to use .NET 4.X in the Player Settings.
  • Configure GameSparks Sample scene as the entry scene (GameSparksTestUI).
  • Build Xcode project.
  • Open it with Xcode 10.1
  • In Xcode, perform Archive and Export into an IPA.
  • Install IPA into target device and try to run (via iTunes).

Notes on this issue:

  • Via the support tickets GameSparks couldn't point out the cause to the issue. They only referred that their SDK only supports .NET 3.5.
  • Configuring the project to use .NET 3.5 would then properly run in an iOS device.
  • When XCode 11 came out, this issue was triggered also with a debugging build directly into the device, and not just when building for release.
  • The Unity Cloud Build team also helped on this matter and they pointed out that "IL2CPP does not implement Debugger.Log unless script debugging is enabled" - and we did not have script debugging enabled in our builds.
  • In the Online GameDev [BaaS] Discord channel, the user Thorvald mentioned this issue does not happen if you set the API Compatibility level to .NET 2 in the Player Settings - I haven't been able to confirm this myself.

@dylanh724
Copy link
Member Author

dylanh724 commented Feb 5, 2020

Somewhat related

Fixing this bug would also likely resolve this issue: #4

@dylanh724
Copy link
Member Author

This is resolved by swapping out native WebSocket with WebSocketSharp. Resolved here: #4 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants