OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
625 stars 215 forks source link

[Bug]: App is unrsponsive on android due to main (blocked) #838

Closed vamsi-kleargroup closed 9 months ago

vamsi-kleargroup commented 9 months ago

What happened?

We are experiencing crash/deadlock on some of our android phones

Steps to reproduce?

1. Installed onesignal_flutter: ^5.0.4
2. Initialize onesignal
3. OneSignal.Debug.setLogLevel(OSLogLevel.verbose);
4. OneSignal.initialize("appid");
5. await OneSignal.login(user.id!);

What did you expect to happen?

I expect the app to run as expected without getting stuck

OneSignal Flutter SDK version

5.0.4

Which platform(s) are affected?

Relevant log output

main (blocked):tid=1 systid=16282 | waiting to lock <0x00dfacbd> (java.util.Collections$SynchronizedMap) held by thread 75
       at com.onesignal.common.r.g.setOptAnyProperty(unavailable:12)
       at com.onesignal.common.r.g.setOptBooleanProperty(unavailable:10)
       at com.onesignal.common.r.g.setOptBooleanProperty$default(unavailable:13)
       at com.onesignal.core.d.d.a.setConsentGiven(unavailable:9)
       at f.k.f.a.setConsentGiven(unavailable:15)
       at f.k.d.o(unavailable:6)
       at com.onesignal.flutter.f.l(unavailable:12)
       at com.onesignal.flutter.f.onMethodCall(unavailable:38)
       at j.a.d.a.j$a.a(unavailable:17)
       at io.flutter.embedding.engine.h.e.k(unavailable:18)
       at io.flutter.embedding.engine.h.e.l(unavailable:40)
       at io.flutter.embedding.engine.h.e.m(unavailable)
       at io.flutter.embedding.engine.h.a.run(unavailable:12)
       at android.os.Handler.handleCallback(Handler.java:958)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:230)
       at android.os.Looper.loop(Looper.java:319)
       at android.app.ActivityThread.main(ActivityThread.java:8918)
       at java.lang.reflect.Method.invoke(Native method)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

Code of Conduct

nan-li commented 9 months ago

Hi @vamsi-kleargroup,

Thanks for reporting, we made fixes to Android to resolve deadlocks and was released in Release 5.1.0. Please upgrade your dependency!

This release bumped our native Android dependency from 5.0.4 to 5.1.2, which includes the fixes.