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

Selecting a link/button in a WebView MAUI app for IOS fails and unexpectedly shuts down app. #21157

Closed
Hassan14072002 opened this issue Mar 12, 2024 · 13 comments
Labels
area-controls-webview WebView platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@Hassan14072002
Copy link

Hassan14072002 commented Mar 12, 2024

Description

My application is a simple WebView of a website. It works fine on Android but in the IOS application any link/button causes the application to close unexpectedly.

Similar issues are found here.
#17923
#11544

(Please note that I am a student, and MAUI tech stack is very new to me so I would appreciate any help and sorry if I am asking about something easily fixed.)

Steps to Reproduce

  1. Create a MAUI app with WebView of website.
  2. Start the app on iOS device.
  3. Try to select any link/button
  4. Crash

Link to public reproduction project repository

No response

Version with bug

8.0.7 SR2

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

17.2 Simulator

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

`2024-03-08 11:05:01.774516+0000 TestMaui2[8858:146865] SecTaskCopyDebugDescription: TestMaui2[8858]/0#-1 LF=0 Thread started: .NET Timer #5 2024-03-08 11:05:02.898907+0000 TestMaui2[8858:146865] [ResourceLoadStatistics] Failed to request allowed query parameters from WebPrivacy. Thread started: <Thread Pool> #6 Thread started: .NET TP Gate #7 Thread started: <Thread Pool> #8 Loaded assembly: /Users/10ticks/Library/Developer/CoreSimulator/Devices/3209D81A-412F-4859-A55D-3CB8D97B8842/data/Containers/Bundle/Application/F6DC503C-0B9E-49BD-85C7-9DEF7B671798/TestMaui2.app/System.Xml.XmlSerializer.dll [External] Thread started: <Thread Pool> #9 Thread started: <Thread Pool> #10 Thread started: <Thread Pool> #11 TestMaui2(8858,0x204da5240) malloc: ** error for object 0x30d14b680: pointer being freed was not allocated TestMaui2(8858,0x204da5240) malloc: ** set a breakpoint in malloc_error_break to debug ================================================================= Native Crash Reporting ================================================================= Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.`
@Hassan14072002 Hassan14072002 added the t/bug Something isn't working label Mar 12, 2024
@jfversluis
Copy link
Member

Please provide a reproduction sample or at the very least some relevant code that you're using here. What is the link that you're trying to open? Are you triggering any code when a link is clicked?

Based on just this information its pretty hard to diagnose what might be going on here.

@jfversluis jfversluis added platform/iOS 🍎 s/needs-info Issue needs more info from the author labels Mar 12, 2024
@Hassan14072002
Copy link
Author

@jfversluis Sure, I have only changed one file to introduce the WebView aspect of my application. This works perfectly well for Android as I am able to click on links within the site such as navigation links, buttons, footer links, etc. On IOS platform my application crashes.

using Microsoft.Maui.Platform;
using System.Runtime.CompilerServices;
namespace MauiApp3
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            var webView = new WebView();
            webView.Source = "https://www.WEBSITE.com/";
            webView.UserAgent = "App" + DeviceInfo.Manufacturer + " " + DeviceInfo.Platform;
            Content = webView;
            InitializeComponent();
        }
    }
}

@Zhanglirong-Winnie Zhanglirong-Winnie added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Mar 14, 2024
@Zhanglirong-Winnie
Copy link
Collaborator

Verified this issue with Visual Studio Enterprise 17.10 Preview 2.0, can repro on .NET 8.0 iOS platform with sample project.
https://github.com/edgarssults/maui-ios-crash
image

@Hassan14072002
Copy link
Author

Verified this issue with Visual Studio Enterprise 17.10 Preview 2.0, can repro on .NET 8.0 iOS platform with sample project. https://github.com/edgarssults/maui-ios-crash image

@Zhanglirong-Winnie Is it possible for you to showcase an example of this implemented?

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Mar 15, 2024
@Hassan14072002
Copy link
Author

Tested the same app on IOS 17.2 Simulator. Success. Everything works as expected.

@Zhanglirong-Winnie
Copy link
Collaborator

Tested the same app on IOS 17.2 Simulator. Success. Everything works as expected.

Please try using the sample project
https://github.com/edgarssults/maui-ios-crash

@Hassan14072002
Copy link
Author

@Zhanglirong-Winnie Tested the sample project https://github.com/edgarssults/maui-ios-crash on IOS 17.4 Simulator and same errors occurred. Links caused a crash. However 17.2 works perfectly fine.

@ovoelke
Copy link

ovoelke commented Mar 18, 2024

I've got the same issue just by using a simple entry-control. It will crash with iOS 17.4 but not with iOS 17.2.

@jfversluis
Copy link
Member

@ovoelke that is probably due to #21057 @Hassan14072002 can you confirm which Xcode version you are using?

@Hassan14072002
Copy link
Author

Hassan14072002 commented Mar 25, 2024

@jfversluis Yes I am using Xcode version 15.3. Developing using iOS 17.2 for now. Does this mean if I roll back to 15.2 It should work just fine with iOS 17.4?

@jfversluis
Copy link
Member

Not sure, since other bugs that have been opened pre-date Xcode 15.3. So this might just be something on our side. If you don't mind you could try it. Xcodes (notice the s at the end) makes it easy to run multiple Xcode versions side-by-side and downgrade relatively easily.

@v-Lily
Copy link

v-Lily commented Mar 26, 2024

I also encountered this issue using Xcode 15.3(IOS 17.4).
The detail logs as following:

Thread 0 Crashed:: tid_103 Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	       0x12288214a __pthread_kill + 10
1   libsystem_pthread.dylib       	       0x1229f4ebd pthread_kill + 262
2   libsystem_c.dylib             	       0x122343d1c abort + 133
3   libmonosgen-2.0.dylib         	       0x10b578b5d sigabrt_signal_handler.cold.1 + 45
4   libmonosgen-2.0.dylib         	       0x10b281430 sigabrt_signal_handler + 176
5   libsystem_platform.dylib      	       0x1227fdfdd _sigtramp + 29
6   ???                           	               0x0 ???
7   libsystem_c.dylib             	       0x122343d1c abort + 133
8   libsystem_malloc.dylib        	       0x1228478b0 malloc_vreport + 926
9   libsystem_malloc.dylib        	       0x122847ab2 malloc_report + 158
10  libicucore.A.dylib            	       0x123d73d6f icu::Locale::setToBogus() + 43
11  libicucore.A.dylib            	       0x123d7584a icu::Locale::operator=(icu::Locale const&) + 30
12  libicucore.A.dylib            	       0x123ee1590 icu::number::UnlocalizedNumberFormatter::locale(icu::Locale const&) && + 14
13  libicucore.A.dylib            	       0x123e8feb7 icu::DecimalFormat::touch(UErrorCode&) + 257
14  libicucore.A.dylib            	       0x123e9052b icu::DecimalFormat::DecimalFormat(icu::UnicodeString const&, icu::DecimalFormatSymbols*, UNumberFormatStyle, UErrorCode&) + 297
15  libicucore.A.dylib            	       0x123efd93f icu::NumberFormat::makeInstance(icu::Locale const&, UNumberFormatStyle, signed char, UErrorCode&) + 1339

@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Mar 28, 2024
@jfversluis jfversluis removed the s/needs-attention Issue has more information and needs another look label Mar 30, 2024
@jfversluis jfversluis added this to the Backlog milestone Mar 30, 2024
@jfversluis
Copy link
Member

I am pretty sure this will be fixed by #21436

Please try the current nightly version or wait for the next service release. If it still happens there, please open a new issue, thanks!

@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2024
@Eilon Eilon added area-controls-webview WebView and removed legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor labels May 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-webview WebView platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants