magiclabs / magic-flutter

Apache License 2.0
10 stars 6 forks source link

Flutter: signout not working #17

Closed majidbashirPL closed 1 year ago

majidbashirPL commented 1 year ago

I was previously using magic_sdk :^0.4.0 later I updated to latest magic_sdk : ^2.0.2

"Application attempted to call on a destroyed WebView" This issue arises every time I logout without exiting the application,

I'm using following code

print(await magic.user.isLoggedIn()); await magic.user.logout().then((_) { print("logout"); });

following logs are printed in console:

W/cr_AwContents ( 5250): Application attempted to call on a destroyed WebView W/cr_AwContents ( 5250): java. lang. Throwable W/cr_AwContents( 5250): atorg.chromium.android_webview.AwContents.r(chromium-TrichromeWebViewGoogle6432.apk -stable-447211484:2) W/cr_AwContents( 5250): a org.chromium.android_webview.AwContents.j(chromium-TrichromeWebViewGoogle6432.apk -stable-447211484:1) W/cr_AwContents ( 5250): a com.android.webview.chromium.WebViewChromium.evaluateJavaScript(chromium-Trichrom eWebViewGoogle6432.apk-stable-447211484:8) W/cr_AwContents ( 5250) : W/cr_AwContents ( 5250) : a android.webkit.WebView.evaluateJavascript(WebView.java:893) atio.flutter.plugins.webviewflutter.WebViewHostApiImpl.evalvateJavascript(WebViewHo stApiImpl. java: 427) W/cr_AwContents ( 5250) : at io.flutter .plugins.webviewflutter. GeneratedAndroidWebView$WebViewHostApi.lambda$s etup$13 (GeneratedAndroidWebView. java: 1044) W/cr_AwContents ( 5250) : atio.flutter.plugins.webviewflutter.GeneratedAndroidWebView$WebViewHostApi$$Externa 1SyntheticLambda21.onMessage(Unknown Source:2) W/cr_AwContents ( 5250): at io.flutter.plugin. common. BasicMessageChannel$IncomingMessageHandler.onMessage(Bas iMessageChannel. java: 217) W/cr_AwContents ( 5250): at io.flutter .embedding. engine. dart. DartMessenger. invokeHandler (DartMessenger. java:2 95) W/cr_AwContents( 5250): at io.flutter .embedding. engine. dart. DartMessenger. lambda$dispatchMessageToQueue$o$io -flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319) W/cr_AwContents ( 5250): atio.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unkn own Source:12) W/cr_AwContents( 5250): W/cr_AwContents ( 5250): W/cr_AwContents ( 5250): W/cr_AwContents ( 5250): W/cr_AwContents ( 5250): W/cr_AwContents ( 5250): at android.os. Handler.handleCallback(Handler. java:938) at android.os. Handler.dispatchMessage (Handler. java:99) at android.os. Looper. loop0nce (Looper. java: 201) at android.os. Looper. loop (Looper. java: 288) at android.app. ActivityThread. main(ActivityThread. java: 7842) at java.lang.reflect. Method. invoke (Native Method)

flutter doctor -v

[✓] Flutter (Channel stable, 3.3.6, on macOS 13.2 22D49 darwin-arm, locale en-PK) • Flutter version 3.3.6 on channel stable at /Users/myuser/Developer/flutter_sdk/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 6928314d50 (4 months ago), 2022-10-25 16:34:41 -0400 • Engine revision 3ad69d7be3 • Dart version 2.18.2 • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4) • Android SDK at /Users/majidbashir/Library/Android/sdk • Platform android-33, build-tools 33.0.0-rc4 • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14C18 • CocoaPods version 1.11.3

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.75.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.58.0

[✓] Connected device (2 available) • macOS (desktop) • macos • darwin-arm64 • macOS 13.2 22D49 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.177

[✓] HTTP Host Availability • All required HTTP hosts are available

• No issues found!