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

crash at com.pichillilorenzo.flutter_inappwebview.in_app_webview.InAppWebView$11.run (InAppWebView.java:1307) #1040

Closed
3 of 4 tasks
rsydor opened this issue Nov 23, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@rsydor
Copy link
Contributor

rsydor commented Nov 23, 2021

very rarely crash. NullPointerException at com.pichillilorenzo.flutter_inappwebview.in_app_webview.InAppWebView$11.run(InAppWebView.java:1307)

Environment

Technology Version
Flutter version 2.2.3
Plugin version 5.3.2
Android version 11
iOS version -
Xcode version -

Device information: XIAOMI POCO X3 Pro

Description

On

**Expected behavior: work without crash

**Current behavior:very rarely crash

Steps to reproduce: at show page with InAppWebView

Widget _buildContent(BuildContext dialogContext, Cubit cubit) { return Container( child: InAppWebView( initialUrlRequest: URLRequest( url: Uri.parse(_params.url), headers: {"'Authorization'": "${_credentials}"}), onWebViewCreated: (InAppWebViewController controller) { controller.addJavaScriptHandler(handlerName:'handler', callback: (args) async { final returnValue = await _onConfirm(args, dialogContext, cubit); if (null != returnValue) { return returnValue; } }); }, ), ); }

Stacktrace/Logcat

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.IBinder android.view.View.getWindowToken()' on a null object reference
at com.pichillilorenzo.flutter_inappwebview.in_app_webview.InAppWebView$11.run(InAppWebView.java:1307)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:8056)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)

@rsydor rsydor added the bug Something isn't working label Nov 23, 2021
@github-actions
Copy link

👋 @rsydor

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

@rsydor
Copy link
Contributor Author

rsydor commented Dec 6, 2021

I searched but I don't find.

@daozhishier
Copy link

Version: 0.4.0, in iOS:

[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: PlatformException(unregistered_view_type, trying to create a view with an unregistered type, unregistered view type: 'com.pichillilorenzo/flutter_inappwebview', null)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)

#2 PlatformViewsService.initUiKitView (package:flutter/src/services/platform_views.dart:236:5)

#3 _UiKitViewState._createNewUiKitView (package:flutter/src/widgets/platform_view.dart:639:44)

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants