Skip to content

Conversation

mustafayildiz12
Copy link

Versions:
flutter: 3.32.0
flutter_inappwebview: ^6.1.5

Error:

Fatal Exception: java.lang.RuntimeException
Unable to destroy activity {com.limakteknoloji.limakmobile/com.limakteknoloji.limakmobile.MainActivity}: java.lang.NullPointerException: Attempt to read from field 'java.lang.String com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview.FlutterWebView.keepAliveId' on a null object reference in method 'void com.pichillilorenzo.flutter_inappwebview_android.webview.InAppWebViewManager.dispose()'

Issue Scenario:

  1. This error happens ın android devices only.
  2. If you use keepAlive and try to dispose it, you will get this error when app is terminated.

After getting this NullPointerException I checked the current code and saw this issue in InAppWebViewManager.java

Just use ;

keepAliveWebViews.remove(keepAliveId);

instead of;

if (keepAliveWebViews.containsKey(keepAliveId)) {
keepAliveWebViews.put(keepAliveId, null);
}

Tested on android 12, 13, 14.

@probot-autolabeler probot-autolabeler bot added android iOS macOS macOS platform web windows Windows platform labels Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

android iOS macOS macOS platform web windows Windows platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant