Repository navigation
Closed
flutter/packages
#8707Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listp: webviewThe WebView pluginThe WebView pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
Description
Steps to reproduce
Some users reported that just opening a webview causes a crash almost every time.
We also got several crash reports on Firebase Crashlytics.
Expected results
I expect the app to not crash when opening a webview.
Actual results
App crashes.
Code sample
Can't really reproduce on my side if I create a minimal sample project, but please check the crash report.
Also, I noted that pinning webview_flutter_wkwebview to 3.17.0 solves the issue, so the bug must got introduced since then.
Screenshots or Video
No response
Logs
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.27.3, on macOS 15.2 24C101 darwin-arm64, locale en-PT)
• Flutter version 3.27.3 on channel stable at /opt/homebrew/Caskroom/flutter/3.13.7/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c519ee916e (9 days ago), 2025-01-21 10:32:23 -0800
• Engine revision e672b006cb
• Dart version 3.6.1
• DevTools version 2.40.2
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
• Android SDK at /Users/antonio/Library/Android/sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 21.0.4+-12422083-b607.1)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16C5032a
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.2)
• 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 21.0.4+-12422083-b607.1)
[✓] VS Code (version 1.96.4)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.102.0
[✓] Connected device (4 available)
• iPhone 16 Pro (mobile) • 01C8DB8E-568F-43FA-A971-626A012767BD • ios •
com.apple.CoreSimulator.SimRuntime.iOS-18-2 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 15.2 24C101 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 15.2 24C101 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 132.0.6834.112
! Error: Browsing on the local area network for António’s iPhone. Ensure the device is unlocked and attached with a cable or
associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
• All expected network resources are available.
• No issues found!Reacted by Raad, Haydar Demir, karlcosse, Benjamin Combes, nytoan, Efthymis Sarmpanis, Pedro Carvalho, rlueders, Malbolged, limenote135 and 51 more
Reacted by Javier del Canto, hagen00, Mohaned Yossry, Rahmi Tufanoglu, Serj Elkins, Yuhei Miura and Mehdi Brahmi
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listp: webviewThe WebView pluginThe WebView pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
Activity
stuartmorgan-g commentedon Jan 30, 2025
@bparrishMines Looks like a regression from the Swift proxy API conversion. This is the relevant part of the crash log:
It looks like the cast in question is
let result = listResponse[0] as! AuthenticationChallengeResponse(here).JediPixels commentedon Jan 30, 2025
Not sure if this is related but when I updated my share_plus: to ^10.1.4 it caused a crash with this error:
I opened an issue with the share_plus plugin at
fluttercommunity/plus_plugins#3450
With the previous share_plus: ^10.1.3 no crashes and it works fine.
JediPixels commentedon Jan 31, 2025
JediPixels commentedon Jan 31, 2025
I believe that something could have also happened with the compatibility of webview_flutter and the WordPress Akismet Anti-spam: Spam Protection plugin.
stuartmorgan-g commentedon Jan 31, 2025
@JediPixels Unless you are using other plugins with severe bugs that cause arbitrary memory to be stomped, they should not be able to cause this crash.
JediPixels commentedon Jan 31, 2025
JediPixels commentedon Jan 31, 2025
after more testing, if the WordPress site uses reCaptcha for the contact forms, but the pages that webview_flutter is loading is not the contact form, could the reCaptcha be causing the error?
AuthenticationChallengeResponseJediPixels commentedon Jan 31, 2025
52 remaining items
mateenshiekh commentedon Mar 6, 2025
stuartmorgan-g commentedon Mar 6, 2025
This is fixed in 3.18.3, so anyone seeing this should
flutter pub upgrade --unlock-transitive webview_flutterto get the latest version ofwebview_flutter_wkwebview.Michael199311 commentedon Mar 8, 2025
Thanks @stuartmorgan , this issue bothered me for weeks, but after I ran
flutter pub upgrade --unlock-transitive webview_flutter, thewebview_flutter_wkwebviewdidn't upgrade to the latest version, it's still in 3.18.1(which is related to the latest version ofwevbiew_flutter).I manually add
webview_flutter_wkwebview: ^3.18.4anywayferdinandfrank commentedon Mar 11, 2025
Are you guys sure that this is fully fixed in
3.18.4?Even though we do not receive the original error (
Could not cast value of type 'NSNull' (0x11c6a0dc8) to 'webview_flutter_wkwebview.AuthenticationChallengeResponse') anymore, we now receive the following two errors on our latest release using this version:These two errors still cause several crashes on our app.
Looking at our
pubspec.lock, we are definitely on the latest version:ferdinandfrank commentedon Mar 18, 2025
I downgraded back to version
3.17.0and can confirm that the issues and crashes are now gone.@bparrishMines I'm pretty sure that there are still related issues with the
3.18.xversions, see my comment above.bparrishMines commentedon Mar 21, 2025
@ferdinandfrank
The WKNavigationDelegate.didReceiveAuthenticationChallenge doesn't contain a
URL, so this is most likely unrelated to this issue. Can you open a separate issue providing more info and an example of how to reproduce?This error could have a different cause to this issue. Can you open a separate issue for this as well? This could be related to #102476.
github-actions commentedon Apr 4, 2025
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, including the output of
flutter doctor -vand a minimal reproduction of the issue.[webview_flutter_wkwebview] Fixes crash where the native `Authenticat…
[webview_flutter_wkwebview] Fixes crash where the native `Authenticat…
[webview_flutter_wkwebview] Fixes crash where the native `Authenticat…
[webview_flutter_wkwebview] Fixes crash where the native `Authenticat…
[webview_flutter_wkwebview] Fixes crash where the native `Authenticat…
[webview_flutter_wkwebview] Fixes crash where the native `Authenticat…