AS-Devs / signalr_flutter

A flutter plugin for .net SignalR client.
https://pub.dev/packages/signalr_flutter
MIT License
19 stars 27 forks source link

flutter build release mod SignalR no connection #19

Closed yasngencc closed 3 years ago

yasngencc commented 3 years ago

uygulamayı derleyip apk oluşturduğumda cihazımda signal bağlantısı Unknown olarak alıyorum. oysa debug modda normal bir şekilde çalışıyor.

yasngencc commented 3 years ago

Screenshot_1610637197 debug mod ... invoke click Screenshot_20210114-181336 release apk ... invoke click

ghulamostafa commented 3 years ago

Maybe your client arguments are not matching or their types are not matching with your server method. https://ghulamustafa.com/2021/01/16/how-to-use-signalr-with-flutter-for-chat/

yasngencc commented 3 years ago

sorun şu şekilde çözüldü

flutter build apk = çalışmadı flutter build apk --release = Çalıştı

AyonAB commented 3 years ago

Sorry for the late reply. You need to add a ProGuard rule for your app and this issue should go away for release builds with minify enabled. R8 is striping away some SignalR classes from the plugin which is creating this issue in release mode.

Add the following line in your proguard-rules.pro file,

-keep class microsoft.aspnet.signalr.client.hubs.** { *; }

I'll be adding this to the example app and also in the readme in near future.