dotnet / dotnet/aspnetcore

SignalR 6.x doesn't work with android il2cpp

Open
#40,569 18 comments 3 reactions 0 assignees View on GitHub
area-signalr bug Priority:3
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

### Is there an existing issue for this?

- [X] 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): ArgumentNullException: Value cannot be null.
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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.