dotnet/aspnetcore

[Java Client] No proguard file declaring that we need to keep class members

Open

#53,238 opened on 2024年1月9日

GitHub で見る
 (2 comments) (2 reactions) (0 assignees)C# (10,653 forks)batch import
area-signalrhelp wanted

Repository metrics

Stars
 (37,933 stars)
PR merge metrics
 (平均マージ 16d 9h) (30d で 258 merged PRs)

説明

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

All Android apps with updated tooling will now use R8 full mode. I do however find it odd that this issue is only occuring for me but I'll post it here and see whether it gets upvoted or not.

TL;DR: Minified app does not get SignalR messages. Reason seems to be the class com.microsoft.signalr.HandshakeResponseMessage.

Expected Behavior

Solution is to add the following to either your app's proguard file or if you have a more module heavy project like I do, add it to your consumer file: -keepclassmembers class com.microsoft.signalr.HandshakeResponseMessage

This could of coarse be me doing something wrong but keeping the class members of this particular class works and I can't find any proguard rules in this repository for the java client or when inspecting the library files.

The rule can likely be more specific and the SignalR client is still quite new to me but figured there must be someone else out there struggling with this 😅

Steps To Reproduce

Android project with minification enabled that subscribes to some SignalR channel.

Exceptions (if any)

None actually. This was a very frustrating thing to figure out as the issue was silent.

.NET Version

No response

Anything else?

SignalR java client versions tested: 8.0.0, 7.0.0 and 7.0.14 Android Gradle Plugin: 8.1.4

コントリビューターガイド