question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SignalR client: RPCs are not invoked on Android client if LLVM is on

See original GitHub issue

Describe the bug

My project is a Xamarin.Forms iOS/Android app. My project’s shared project is a normal platform independent Xamarin.Forms .NET Standard 2.1 project. Said project is referencing the Microsoft.AspNetCore.SignalR.Client library.

There are several RPC registered to a HubConnection:

connection.On("SomeRPC", () =>
{
    Console.WriteLine("HELLO!");
});

These work flawlessly in all permutations of release configurations except one.

iOS: AOT + LLVM: Works – RPCs are invoked (i.e. connection.On callbacks are invoked). Android: AOT: Works – RPCs are invoked (i.e. connection.On callbacks are invoked). Android AOT + LLVM: Doesn’t work! RPCs are never invoked.

To Reproduce

  1. Set up a Xamarin.Forms application.
  2. Add the Microsoft.AspNetCore.SignalR.Client NuGet to the shared project. Note: Use 6.0.0-preview1 because of this issue: https://github.com/dotnet/aspnetcore/issues/33269
  3. Register some connection.On RPCs.
  4. Use some means to invoke the RPCs (from some test server I guess).
  5. Optional: Build and run a release build for iOS with AOT + LLVM on to verify that the RPCs are invoked.
  6. Optional: Build and run a release build for Android with AOT on to verify that the RPCs are invoked.
  7. Build and run a release build for Android with AOT + LLVM on to verify that the RPCs are not invoked.

(In the off-chance that Android LLVM builds fail to build, follow the workaround at https://github.com/xamarin/xamarin-android/issues/5764#issuecomment-856062396 until https://github.com/xamarin/xamarin-android/issues/5764 is fixed.)

So all in all, turning LLVM on for Android builds makes RPCs not being called anymore. This effectively prevents one from using LLVM on Android until this issue is fixed.

Exceptions (if any)

None. Breakpoints show that the RPCs are not invoked on Android when LLVM is turned on, but there are no exceptions.

Further technical details

  • Microsoft.AspNetCore.SignalR.Client version: 6.0.0-preview1
  • Xamarin.Forms version: 5.0.0-2012
  • VS For Mac version: 8.10.1

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
davidfowlcommented, Jun 12, 2021

SignalR doesn’t support linking in any form. We want to, we just have never done so. I’ve mentioned this several times. This includes AOT compiled Xamarin platforms that perform or Unity without work on the user’s end part. Many people have gotten SignalR to work on these platforms but

We’ll gladly fix issues identified by passionate members such as yourself who report them and help us support the existing platforms. Beyond that, we have no plans to do anything here in the short term.

0reactions
msftbot[bot]commented, Jun 14, 2021

We’ve moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

Read more comments on GitHub >

github_iconTop Results From Across the Web

asp.net - Signal R Client Methods are not invoked
I have developed simple chat system using signal R . In case when internet is disconnect and reconnect after 2 minutes all signal...
Read more >
Questions in topic: "client-server" - Browse the Latest Snapshot
Hey, long story short, I am making a vehicle asset mod for a game on a unity base, Unturned and specifically, I am...
Read more >
Client Rpc not being called why is this?
In my case I have a network object that is spawned to all clients, and this object has a networkbehavior component with an...
Read more >
Package List
This is a list of things you can install using Spack. It is automatically generated based on the packages in this Spack version....
Read more >
Progressive, Performant, Polymer: Pick Three - Google I/O 2016
A great app provides an immersive client -side experience. ... But a set of new technologies shipping in the modern web platform all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found