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

  • Question

  • User1248192397 posted

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

    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:


    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&#39;t have any breadcrumbs to point me where I should look next. Anyone have any leads for me to follow?

    Thursday, November 19, 2020 2:23 PM


  • User1248192397 posted

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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 20, 2020 8:05 PM