dotnet / dotnet/aspnetcore

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

Open
#53,238 3 comments 2 reactions 0 assignees View on GitHub
area-signalr help wanted
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [X] 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

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.