Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Application crashes when initialization fails #144

Closed
iassal opened this issue Jul 12, 2020 · 1 comment · Fixed by #145
Closed

[Android] Application crashes when initialization fails #144

iassal opened this issue Jul 12, 2020 · 1 comment · Fixed by #145

Comments

@iassal
Copy link
Contributor

iassal commented Jul 12, 2020

When onDetachedFromEngine gets triggered, if for any reason, channel was null, the app crashes.

@iassal
Copy link
Contributor Author

iassal commented Jul 12, 2020

Sample Stack trace

Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {REDACTED}: java.lang.NullPointerException: Attempt to invoke virtual method 'void io.flutter.plugin.common.MethodChannel.setMethodCallHandler(io.flutter.plugin.common.MethodChannel$MethodCallHandler)' on a null object reference
       at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3869)
       at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3887)
       at android.app.ActivityThread.access$1500(ActivityThread.java:165)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1430)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:150)
       at android.app.ActivityThread.main(ActivityThread.java:5621)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant