SignalR 6.x doesn't work with android il2cpp
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Describe the bug
(Building with Unity) SignalR 6.x (6.0.0, 6.0.1, 6.0.2) doesn’t work with android on IL2CPP. Works fine on windows il2cpp builds. Reverting to 5.x fixes the issue.
Expected Behavior
No response
Steps To Reproduce
- Create a unity project
- Add SignalR 6.x libraries
- Add a script that creates the hub connection, like this:
var connection = new HubConnectionBuilder().WithUrl("http://localhost:5014/game").Build();
- Build with Il2CPP to android
- Exception (see below) is thrown when calling
.Build()
Exceptions (if any)
03-06 12:42:04.721: E/Unity(28182): Parameter name: obj
03-06 12:42:04.721: E/Unity(28182): at System.Threading.Monitor.ReliableEnterTimeout (System.Object obj, System.Int32 timeout, System.Boolean& lockTaken) [0x00000] in <00000000000000000000000000000000>:0
03-06 12:42:04.721: E/Unity(28182): at Microsoft.Extensions.DependencyInjection.DependencyInjectionEventSource.ServiceProviderBuilt (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) [0x00000] in <00000000000000000000000000000000>:0
03-06 12:42:04.721: E/Unity(28182): at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor (System.Collections.Generic.ICollection`1[T] serviceDescriptors, Microsoft.Extensions.DependencyInjection.ServiceProviderOptions options) [0x00000] in <00000000000000000000000000000000>:0
03-06 12:42:04.721: E/Unity(28182): at Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider (Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.DependencyInjection.ServiceProviderOptions options) [0x00000] in <00000000000000000000000000000000>:0
03-06 12:42:04.721: E/Unity(28182): at Mi```
### .NET Version
_No response_
### Anything else?
_No response_
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
SignalR HubConnectionBuilder fails when run ... - Issue Tracker
Go to Window > Package Manager and add Android LogCat from Unity Registry 5. Go to Window > Analysis and open the Android...
Read more >[Unity] Communicate with SignalR from Unity
I can connect SignalR hub by AspNetCore.SignalR.Client. ... One important problem is I can't use NuGet for Unity applications.
Read more >Adding Unity Support - SignalR in Unity - Part 2 - YouTube
That Unity and our SignalR server can connect with one another. ... channel in the Microsoft Reactor ( and even come to our...
Read more >Unity: SignalR connection working in editor but not ...
I am a beginner, I have connected SignalR to my application, it works fine, it sends / receives data. But everything works only...
Read more >NET 4.6 Dll's references problem
So the idea is to put SignalR 2.2.2 inside Unity. Everything works just fine : I managed to change the target framework to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I use this workaround to bypass that error:
Also 2 additional classes are needed:
Just tested the preview version (7.x), and the exception still occours. Will be using 5.0.17 for our project, but would like to use the newer version. When I have time, I’ll try to debug this more.