Comments (24)
We experience the same issue with iOS 18 Beta 2 as well (was working on Beta 1).
A workaround is to set the base url using reflecting as first action in the MauiProgram.cs
var handlerType = typeof(BlazorWebViewHandler);
var field = handlerType.GetField("AppOriginUri", BindingFlags.Static | BindingFlags.NonPublic) ?? throw new Exception("AppOriginUri field not found");
field.SetValue(null, new Uri("app://localhost/"));
Then the app works like before, so I can confirm the above workaround works with Maui Blazor as well.
from maui.
FYI @Eilon @mkArtakMSFT we probably want to fix this before Sept!
from maui.
Thank you again to everyone for the reports, investigations, and the tip on how to fix it! The PR was merged so this will be available in the next .NET MAUI 8 service release, and also will be ported to the .NET MAUI 9 branches.
As an aside, if anyone can find docs from Apple on this change of behavior I'd love to learn more. I couldn't find any release notes or info from Apple about changes to the iOS/MacCatalyst WebView that are relevant to this (I found other notes, but nothing about this). We'd love to catch these types of things by reading release notes as opposed to finding out after it's already not working.
from maui.
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Closed similar issues:
- Blazor Hybrid is not supported on Macs running MacOS 11. (#19613), similarity score: 0.81
- [macOS] [8.0] Hybrid app crashed after launch on macOS 12.4 (#19904), similarity score: 0.78
- MAUI Blazor app crashes during startup on MacBook M1 (#20426), similarity score: 0.77
- Maui BlazorWebView MacOS issues (#10843), similarity score: 0.77
- Maui-Blazor (Hybrid) MacCatalyst app will not run on older MacOS (#19808), similarity score: 0.76
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
from maui.
Thanks @Eilon ! For what it worth, on MacOs at least, I released an update of DevToys with my own fix and so far, customers are happy.
from maui.
from maui.
I saw this article, maybe it's helpful
https://www.oligo.security/blog/0-0-0-0-day-exploiting-localhost-apis-from-the-browser
from maui.
I saw this article, maybe it's helpful
https://www.oligo.security/blog/0-0-0-0-day-exploiting-localhost-apis-from-the-browser
Wow fascinating! Perhaps we should do an even broader fix for the next patch because it sounds like maybe this could affect all platforms in the future?
from maui.
While investigating further, we noticed some strange behavior when fetching data via JavaScript.
These requests do not seem to work.
One possible cause could be that the check in the following method now is never true, as we cannot change the const BlazorWebView.AppHostAddress
which is used.
To my understanding this check, redirects the request back to the app basically.
Thus, the proposed workaround is not really working anymore :/
@jfversluis A fix is now strictly required imho.
We tested with localhost on both iOS 17 and 18 devices, and besides the above issue had no other problems.
from maui.
Alright I'm like this --> <-- close to getting macOS 15 Beta installed on my Mac. Thank you for all the investigations and feedback. Hopefully this is an easy fix!
from maui.
Alright all it took was getting a different Mac and downloading 40GB of updates 😁 But I can repro this on my Mac on iOS 18 Simulator - the BlazorWebView just doesn't show up at all.
I'll confirm that the suggested workaround works as a start.
But then we'll need to make sure we have a solution that works on both iOS 17 and older, but also iOS 18 and newer, and the respective MacCatalyst versions (for running on macOS desktop).
from maui.
I've got a PR here that I think should fix the issue: #23906
from maui.
@Eilon even after updating to maui
8.0.80
my Blazor hybrid app still experiences this problem. iPhone with iOS 18.0 beta 5 still shows empty screen
Hmm I checked that release and it seems to have the fix in it.
Some questions/ideas:
- Did you accidentally also set the AppSwitch? It must not be set - it's only there to undo the patch in case it breaks someone.
- Did you try on physical iOS device, or Simulator, or both? If not both, can you try on both?
- Can your app run on macOS/MacCatalyst? If so, does the issue happen there?
- Can you try uninstalling and re-installing the app on the device?
- Did you do a
git clean -xdf
(delete all untracked files in your repo - or whatever equivalent command), and then do a clean build after upgrading the package?
Hopefully we can figure this out!
from maui.
This was the only change I did. And the release was done through github actions, so no old artifacts should be in the new build.
But after running the pipeline 2nd time, uninstalling the old version and installing the new one it finally works.
Thanks you for your help!
from maui.
This was the only change I did. And the release was done through github actions, so no old artifacts should be in the new build. But after running the pipeline 2nd time, uninstalling the old version and installing the new one it finally works.
Thanks you for your help!
Thanks for confirming you got it working! That's definitely odd.
@Kebechet if you or anyone else sees this again please let me know!
If you do still have the 'broken' IPK (or whatever file it was), it could be interesting to look inside it to see which DLLs made it into the package and see what version they are stamped with.
from maui.
I am also having this same error on my maui/blazor hybrid app. It sounds like the maui worklaod 8.0.80 may have the correct fix. However, my system is not updating past:
maui 8.0.61/8.0.100 SDK 8.0.300
I am running macOS. Is there troubleshooting around how to update to this 8.0.80 version?
@sdonoghue76 can you try manually updating the reference in your app's CSPROJ file from:
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="$(MauiVersion)" />
To:
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.80" />
And see if that updates the version in the app?
from maui.
I am also having this same error on my maui/blazor hybrid app. It sounds like the maui worklaod 8.0.80 may have the correct fix. However, my system is not updating past:
maui 8.0.61/8.0.100 SDK 8.0.300
I am running macOS. Is there troubleshooting around how to update to this 8.0.80 version?@sdonoghue76 can you try manually updating the reference in your app's CSPROJ file from:
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="$(MauiVersion)" />
To:
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.80" />
And see if that updates the version in the app?
Thank you @Eilon .
That app is now running correctly on iOS 18 with this change.
I can just revert back to $(MauiVersion) parameters when 8.0.80 workload is associated.
Thanks again.
from maui.
Further Investigation
Continuing my investigation on DevToys side, I found that StartUrlSchemeTask is never invoked.
A Potential Solution for DevToys and .NET MAUI
After some time, I kind of dumbly decided to change the app host address from 0.0.0.0
to localhost
, "just in case", and it worked!
I suspect a fix for MAUI is similar. Please try changing this line to app://localhost/
to see if it works.
Consideration
Now I'm concerned with the retro compatibility with older MacOS version. I will try getting out of MacOS 15 Beta and test on MacOS 14.
While my problem is fixed, .NET MAUI Blazor Hybrid still doesn't work at all on MacOS 15, so I will leave this issue open for now and will let you decide what to do with it :-)
from maui.
I am seeing the same using MAUI blazor on iOS 18 beta 2 as well.
from maui.
can confirm that this is also an issue on iOS 18 Beta 2
I will test the workaround now
from maui.
We experience the same issue with iOS 18 Beta 2 as well (was working on Beta 1).
A workaround is to set the base url using reflecting as first action in the MauiProgram.cs
var handlerType = typeof(BlazorWebViewHandler); var field = handlerType.GetField("AppOriginUri", BindingFlags.Static | BindingFlags.NonPublic) ?? throw new Exception("AppOriginUri field not found"); field.SetValue(null, new Uri("app://localhost/"));
Then the app works like before, so I can confirm the above workaround works with Maui Blazor as well.
Workaround works on macos 15 sequoia maui blazor hybrid, saved my life, i was going to format the mac and revert to sonoma
from maui.
Hello there,
I'm experiencing the same of behaviour in my NET8.0-iOS app running on iOS 18.3 Beta. The app crashes on launch while showing the splashscreen. In the stacktrace of the crash no leads are to be found. Did someone experience the same thing? The solution described above isn't applicable for my app unfortunately.
from maui.
@Eilon even after updating to maui 8.0.80
my Blazor hybrid app still experiences this problem.
iPhone with iOS 18.0 beta 5 still shows empty screen
from maui.
I am also having this same error on my maui/blazor hybrid app. It sounds like the maui worklaod 8.0.80 may have the correct fix. However, my system is not updating past: maui 8.0.61/8.0.100 SDK 8.0.300
I am running macOS.
Is there troubleshooting around how to update to this 8.0.80 version?
from maui.
Related Issues (20)
- Unexpected Syntax Error in blazor.webview.js on iOS lower than v17 in .NET 9 Pre7 HOT 9
- Entry no focus possible when table section title is set
- [Debug Mode Performance] XAML parsing events
- [9.0 Preview 7, Android and Windows] XamlC fails in Debug with _MauiForceXamlCForDebug but works in Release HOT 2
- System.TypeLoadException (System.Reflection.AssemblySignatureKeyAttribute) when debugging on iOS HOT 4
- [Testing] Resolve FlyoutHeaderAdaptsToMinimumHeight Failures
- [iOS, .NET 9.0 Preview 7] Border size changes are animated on iOS HOT 2
- Erro ao Criar um projeto com o .NET MUI APP HOT 2
- Shell Relative Routes Documentation Incorrect? HOT 2
- [Windows, 9.0 Preview 7] Debugger crashes the app on Windows almost immediately in debug configuration HOT 3
- [Windows, 9.0 Preview 7] Keyboard events are not firing anymore HOT 1
- El sdk microsoft.net.sdk especificado no se pudo encontrar HOT 1
- Line break modes are not working on html text type HOT 6
- Issue with iOS Application Icon: App Store Publishing Failed - AppIcon Missing (Asset Validation Error) HOT 9
- Localizing strings in iOS Info.Plist not working after updating to MAUI 8.0.80 HOT 2
- Crash on NullReferenceException with measurement cells in CollectionView HOT 5
- ListView with DataTemplate: rendering and scrolling broken on iOS HOT 3
- [Windows] Optimize WrapperView HOT 2
- Making previously hidden Border visible has a "jelly effect" on iOS HOT 3
- RelativeSource Binding Does Not Work For PlatformBehaviors (MCT Touch Behavior) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maui.