Closed shihaohong closed 1 year ago
Have you looked at the logs for the steps you provided? They don't reproduce the crash you've been trying to investigate. The steps you shared are to do with how plugin gets detached from the engine (i.e. gets disposed) and recreates so the plugin won't get to process the response. As far as I know, this is because the Flutter engine itself gets disposed so there's nothing else that can be done here. This means others plugins will show a similar behaviour e.g. see google_sign_in.
Unless you can provide actual steps to reproduce this, it's difficult to say what is going on and would be based on speculation. It'd be best if the actual root cause can be identified and fixed rather than putting in speculative fixes that get pushed to the community. There have been similar reports on this before but no one has yet to provide info on how to reproduce this. For all I know, those reporting this issue may also be trying to call the plugin when the Flutter engine/app is being disposed.
On our Android app, we've been running into intermittent crashers related to null exceptions involving the Android Activity being null. We suspect that this is caused by the OS killing the activity before the user completes login.
Steps to reproduce
Error logs on Crashlytics
These logs are what we think are related to the issue, but we're just speculating and these errors might be a symptom of a different problem. We think this line of code is to blame:
https://github.com/MaikuB/flutter_appauth/blob/09cc5e29d88b833f714ba2cfc0a5da7b707004ba/flutter_appauth/android/src/main/java/io/crossingthestreams/flutterappauth/FlutterAppauthPlugin.java#L362