flutter_facebook_login icon indicating copy to clipboard operation
flutter_facebook_login copied to clipboard

Crash on Production App - java.lang.IllegalStateException

Open allanwolski opened this issue 7 years ago • 13 comments

We have received many bug reports with failed Facebook plugin.

  • Motorola Moto G4 Play (harpia_t), Android 7.1
  • Asus ZenFone 4 Selfie (ZD553KL) (ASUS_X00LD_1), Android 7.1
  • Motorola Moto C Plus (panell_dt), Android 7.0
  • Motorola Moto G (5th Gen) (cedric), Android 8.1
  • Motorola moto g(6) play (aljeter), Android 8.0
  • Positivo Twist 4G (S520_4G), Android 6.0
  • Samsung Galaxy J5 Pro (j5y17lte), Android 8.1
java.lang.RuntimeException: 
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4130)
  at android.app.ActivityThread.handleSendResult (ActivityThread.java:4173)
  at android.app.ActivityThread.-wrap20 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1546)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:154)
  at android.app.ActivityThread.main (ActivityThread.java:6165)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:888)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:778)
Caused by: java.lang.IllegalStateException: 
  at io.flutter.view.FlutterNativeView$1.reply (FlutterNativeView.java:174)
  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success (MethodChannel.java:203)
  at com.roughike.facebooklogin.facebooklogin.FacebookLoginResultDelegate.finishWithResult (FacebookLoginResultDelegate.java:58)
  at com.roughike.facebooklogin.facebooklogin.FacebookLoginResultDelegate.onCancel (FacebookLoginResultDelegate.java:43)
  at com.facebook.login.LoginManager.finishLogin (LoginManager.java:634)
  at com.facebook.login.LoginManager.onActivityResult (LoginManager.java:244)
  at com.facebook.login.LoginManager$1.onActivityResult (LoginManager.java:173)
  at com.facebook.internal.CallbackManagerImpl.onActivityResult (CallbackManagerImpl.java:95)
  at com.roughike.facebooklogin.facebooklogin.FacebookLoginResultDelegate.onActivityResult (FacebookLoginResultDelegate.java:53)
  at io.flutter.app.FlutterPluginRegistry.onActivityResult (FlutterPluginRegistry.java:210)
  at io.flutter.app.FlutterActivityDelegate.onActivityResult (FlutterActivityDelegate.java:139)
  at io.flutter.app.FlutterActivity.onActivityResult (FlutterActivity.java:138)
  at android.app.Activity.dispatchActivityResult (Activity.java:6946)
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4126)

allanwolski avatar Nov 19 '18 11:11 allanwolski

Can second this. Happened on Samsung Galaxy S9 (Android 8.0):

java.lang.RuntimeException: 
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4489)
  at android.app.ActivityThread.handleSendResult (ActivityThread.java:4532)
  at android.app.ActivityThread.-wrap20 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1752)
  at android.os.Handler.dispatchMessage (Handler.java:105)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:6938)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)
Caused by: java.lang.IllegalStateException: 
  at io.flutter.view.FlutterNativeView$1.reply (FlutterNativeView.java:174)
  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success (MethodChannel.java:203)
  at com.roughike.facebooklogin.facebooklogin.FacebookLoginResultDelegate.finishWithResult (FacebookLoginResultDelegate.java:58)
  at com.roughike.facebooklogin.facebooklogin.FacebookLoginResultDelegate.onSuccess (FacebookLoginResultDelegate.java:38)
  at com.roughike.facebooklogin.facebooklogin.FacebookLoginResultDelegate.onSuccess (FacebookLoginResultDelegate.java:13)
  at com.facebook.login.LoginManager.finishLogin (LoginManager.java:639)
  at com.facebook.login.LoginManager.onActivityResult (LoginManager.java:244)
  at com.facebook.login.LoginManager$1.onActivityResult (LoginManager.java:173)
  at com.facebook.internal.CallbackManagerImpl.onActivityResult (CallbackManagerImpl.java:95)
  at com.roughike.facebooklogin.facebooklogin.FacebookLoginResultDelegate.onActivityResult (FacebookLoginResultDelegate.java:53)
  at io.flutter.app.FlutterPluginRegistry.onActivityResult (FlutterPluginRegistry.java:210)
  at io.flutter.app.FlutterActivityDelegate.onActivityResult (FlutterActivityDelegate.java:139)
  at io.flutter.app.FlutterActivity.onActivityResult (FlutterActivity.java:138)
  at android.app.Activity.dispatchActivityResult (Activity.java:7548)
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4485)

KammererTob avatar Dec 18 '18 13:12 KammererTob

Most likely a duplicate result.success() call somewhere: https://github.com/flutter/engine/blob/bc885f319b2fdf471cf1efdf733a2f6708bd4665/shell/platform/android/io/flutter/view/FlutterNativeView.java#L174

Not able to reproduce though for some reason.

roughike avatar Jan 16 '19 13:01 roughike

Did you solve it? I think the problem I encountered is the same as yours.

lizhuoyuan avatar Jan 29 '19 02:01 lizhuoyuan

I have received a bug report with a failed Facebook plugin.

Samsung SM-J415FN Android 8.1 Moto G (5) Plus Android 8.1

Abgaryan avatar Mar 04 '19 10:03 Abgaryan

This crash is still recorded by Google Play Console.

  • Android: 8.0
  • Device: Motorola moto e5 plus (rhannah)

Logs

java.lang.RuntimeException: 
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4445)
  at android.app.ActivityThread.handleSendResult (ActivityThread.java:4488)
  at android.app.ActivityThread.-wrap20 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1697)
  at android.os.Handler.dispatchMessage (Handler.java:105)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:6694)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:769)
Caused by: java.lang.IllegalStateException: 
  at io.flutter.view.FlutterNativeView$1.reply (FlutterNativeView.java:174)
  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success (MethodChannel.java:203)
  at com.roughike.facebooklogin.facebooklogin.FacebookLoginResultDelegate.finishWithResult (FacebookLoginResultDelegate.java:58)
  at com.roughike.facebooklogin.facebooklogin.FacebookLoginResultDelegate.onCancel (FacebookLoginResultDelegate.java:43)
  at com.facebook.login.LoginManager.finishLogin (LoginManager.java:703)
  at com.facebook.login.LoginManager.onActivityResult (LoginManager.java:245)
  at com.facebook.login.LoginManager$1.onActivityResult (LoginManager.java:174)
  at com.facebook.internal.CallbackManagerImpl.onActivityResult (CallbackManagerImpl.java:92)
  at com.roughike.facebooklogin.facebooklogin.FacebookLoginResultDelegate.onActivityResult (FacebookLoginResultDelegate.java:53)
  at io.flutter.app.FlutterPluginRegistry.onActivityResult (FlutterPluginRegistry.java:210)
  at io.flutter.app.FlutterActivityDelegate.onActivityResult (FlutterActivityDelegate.java:139)
  at io.flutter.app.FlutterActivity.onActivityResult (FlutterActivity.java:138)
  at android.app.Activity.dispatchActivityResult (Activity.java:7250)
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4441)

allanwolski avatar Mar 06 '19 18:03 allanwolski

Most likely a duplicate result.success() call somewhere: https://github.com/flutter/engine/blob/bc885f319b2fdf471cf1efdf733a2f6708bd4665/shell/platform/android/io/flutter/view/FlutterNativeView.java#L174

Not able to reproduce though for some reason.

Looks like this extra call of result.success() because of finishWithResult method.

You call this method not only for success case, but for a cancel scenario and for an error case.

Maybe somehow Native FB library calls onSuccess and onCancel(or onError) at the same time.

alexeylanars avatar Mar 18 '19 10:03 alexeylanars

any update?

garbirel94 avatar Dec 18 '19 08:12 garbirel94

Many bug reports in my current project with failed Facebook plugin

garbirel94 avatar Dec 18 '19 09:12 garbirel94

any fixe??

ghost avatar Jul 14 '20 06:07 ghost

facing same issue resolve it please

talhakhan011 avatar Jul 15 '20 09:07 talhakhan011

anyone have alternative?please argent my app is in production more than 2k+ users

ghost avatar Jul 15 '20 10:07 ghost

@sanjeevbaria same here but cant figure it out how to resolve

talhakhan011 avatar Jul 15 '20 11:07 talhakhan011

Has anyone actually managed to reproduce the issue and not just receive crash logs? I've also received few crash reports related to this issue. I managed to get a Galaxy S9 (which seems to have the issue as @KammererTob mentioned) with Android 10 on it, but I haven't really figured out how the issue comes up. Reproducing the issue could really help out with possibly solving this.

JaniL avatar Jul 22 '20 11:07 JaniL