SignalR stops working in Xamarin.Forms Android app after migration of backend server and app to .NET Core 3.1

Adam Taylor 111 Reputation points
2020-11-18T21:41:36.783+00:00

I am working on migrating my website from ASP.NET Framework to ASP.NET Core, and have hit an issue in my final step of updating my Xamarin Forms app to connect with the migrated signalR on the backend. I got my app migrated, everything worked in the emulators and on my physical device (LG V50 THINQ) via USB in Debug configuration, so I deployed my Release configuration APKs to Google Play. However, when I went to install the app onto the same physical device from the Google Play store, signalR stopped working.

First, there appear to be no issues with the backend. I'm not ruling it out completely, but what I have documented so far does not point to backend issues. Also, to note, I am currently set up in my app to generate one package (.apk) per selected ABI. The architectures I have been uploading to the Play Store up to this point are armeabi-v7a and arm64-v8a.

To track this down, I took the follow steps:

  1. Ran my Release configuration on the emulator - WORKED
  2. Ran my Release configuration from VS 2019 on device via USB - FAILED - Device log showed outbound call to signalR hub and signalR hub showed everything connected fine and tried to call device client as expected, but device log did not show that the inbound call from the signalR hub was successful.
  3. Toggled settings in Release config to bring it in line with the Debug config until I found that toggling the following settings in the Android Options panel allowed the app to receive the call back from the signalR hub to work: <DebugSymbols>true</DebugSymbols>
    <Optimize>false</Optimize>
  4. I then tried uploading APKs to Google Play with these options set and deploying to device from Google Play - FAILED
  5. At this point, I took a step back, copied the signed APK for armeabi-v7a directly to the V50 (the same APK I had uploaded to the Play Store) and installed the APK manually - WORKED
  6. I uninstalled the armeabi-v7a APK, and then directly copied and manually installed the signed APK for arm64-v8a to the V50 - FAILED
  7. I reverted Release config settings back to default, built and signed new APKs, and found that even under the original, default Release configuration armeabi-v7a WORKED and arm64-v8a FAILED.

So, I know two things:

  • On the V50 device, the 32-bit armeabi-v7a 32-bit APK works with signalR and the 64-bit arm64-v8a APK does not work with signalR under default Release configuration settings (but I still don't know why).
  • If I update the Release config settings as shown above for those two items (and both are required), I can debug on the V50 running the Release config straight from VS 2019, but those settings do not change behavior once deployed out as a signed APK.

At this point, I am stumped. Feels like an issue with 64-bit vs 32-bit, but don't have any breadcrumbs to point me where I should look next. Anyone have any leads for me to follow?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,348 questions
Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
142 questions
{count} vote

Accepted answer
  1. Adam Taylor 111 Reputation points
    2020-11-20T20:06:36.387+00:00

    OK, finally found the apparent culprit.  Had to disable "Use LLVM Optimizing Compiler" and signalR started working with arm64-v8a.
    41490-image.png

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.