From 93f51086e19e3a4944a297ff905be315273bdf8f Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Mon, 12 Jun 2023 08:58:53 +0200 Subject: [PATCH] fix #1691 --- CHANGELOG.md | 4 ++++ .../webview/in_app_webview/InAppWebViewChromeClient.java | 5 ++++- pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0239247d..28c265c4 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.0.0-beta.24+1 + +- Fixed "Can't compile on Android" [#1691](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1691) + ## 6.0.0-beta.24 - Added InAppWebView keep alive feature diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewChromeClient.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewChromeClient.java index fc58a282..8a3c9e5d 100755 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewChromeClient.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewChromeClient.java @@ -670,7 +670,7 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR } if (inAppWebView != null && inAppWebView.channelDelegate != null) { - int finalWindowId = windowId; + final int finalWindowId = windowId; inAppWebView.channelDelegate.onCreateWindow(createWindowAction, new WebViewChannelDelegate.CreateWindowCallback() { @Override public boolean nonNullSuccess(@NonNull Boolean handledByClient) { @@ -1185,6 +1185,9 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR Log.e(LOG_TAG, "Error occurred while creating the File", e); e.printStackTrace(); } + if (capturedFile == null) { + return null; + } // for versions below 6.0 (23) we use the old File creation & permissions model if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { diff --git a/pubspec.yaml b/pubspec.yaml index ad9fdc6c..1cd99cb4 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_inappwebview description: A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window. -version: 6.0.0-beta.24 +version: 6.0.0-beta.24+1 homepage: https://inappwebview.dev/ repository: https://github.com/pichillilorenzo/flutter_inappwebview issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues