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

MAUI Blazor in .NET 9 does not run on Android API level 31 and below #25862

Closed
thomasbach-dk opened this issue Nov 14, 2024 · 9 comments
Closed
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView i/regression This issue described a confirmed regression on a currently supported version platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@thomasbach-dk
Copy link

thomasbach-dk commented Nov 14, 2024

Description

I am currently playing with an upgrade from .NET 8 to .NET 9. We have a .NET MAUI Blazor (Hybrid) app, and when we run the app on Android (emulator) API level 31 we get the following console error:

11-14 13:12:32.688 I/chromium(12480): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token '{'", source: https://0.0.0.0/_framework/blazor.webview.js (1)
[INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token '{'", source: https://0.0.0.0/_framework/blazor.webview.js (1)

This error prevents the app from loading.

Running the app on Android API level 32 and above the issue does not occur.

In terms of the documentation of .NET 9 Android API level 24 should be supported.

UPDATE:
I figured out that updating the Android System WebView in the emulator fixed this issue.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

9.0.0 GA

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.402

Affected platforms

Android

Affected platform versions

Android API level 31 and below (Android 12 and below)

Did you find any workaround?

No

Relevant log output

11-14 13:12:32.688 I/chromium(12480): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token '{'", source: https://0.0.0.0/_framework/blazor.webview.js (1)
[INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token '{'", source: https://0.0.0.0/_framework/blazor.webview.js (1)
@thomasbach-dk thomasbach-dk added the t/bug Something isn't working label Nov 14, 2024
@caoyiliang
Copy link

Image
我也发生了,我是Android10,使用新建的项目出现了同样的错误,设备链接:https://www.zebra.cn/cn/zh/support-downloads/mobile-computers/handheld/tc21.html

@Ying-6
Copy link

Ying-6 commented Nov 15, 2024

This issue has been verified using Visual Studio 17.13.0 Preview 1.0 (9.0.10 & 9.0.0). Can repro this issue. Works fine on 8.0.40 & 8.0.100.

@Ying-6 Ying-6 added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage i/regression This issue described a confirmed regression on a currently supported version labels Nov 15, 2024
@Eilon Eilon added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Nov 15, 2024
@Eilon
Copy link
Member

Eilon commented Nov 15, 2024

Possible dupe: dotnet/aspnetcore#53699 (the error in the other issue is slightly different, but possibly same root cause)

@danroth27
Copy link
Member

Closing as a duplicate of dotnet/aspnetcore#53699

@danroth27 danroth27 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2024
@capdiem
Copy link

capdiem commented Nov 19, 2024

So this is a BREAKING CHANGE and cannot be avoided 👎

@danroth27
Copy link
Member

So this is a BREAKING CHANGE and cannot be avoided 👎

@capdiem Are you seeing your app end users impacted by this change? Or are you only hitting this during development with the Android emulator? Our theory here is that most app users will have an up-to-date web view on Android.

@capdiem
Copy link

capdiem commented Nov 20, 2024

@danroth27 We have various testing phones with different versions and models to ensure that users do not encounter issues on their devices. A phone running Android 11 with WebView version 90.0.4430.210 is not functioning properly after the upgrade.

This link points to a Chrome version 90.0.4427.0, which also encounters this error. The error points to the static keyword.

@capdiem
Copy link

capdiem commented Nov 20, 2024

@danroth27 I found that the issue is not with TypeScript, but rather that the generated release file contains the code static{this.nextEventDelegatorId=0}. Normally, it should generate static nextEventDelegatorId = 0. You can find in https://github.com/dotnet/aspnetcore/blob/main/src/Components/Web.JS/dist/Release/blazor.webassembly.js

@danroth27
Copy link
Member

danroth27 commented Nov 21, 2024

A phone running Android 11 with WebView version 90.0.4430.210 is not functioning properly after the upgrade.

@capdiem That WebView version is very old. Is this a physical device that just hasn't had it's WebView updated? Or is this an emulated device with the default WebView version that came with Android 11?

To be clear, our official support policy is that we only support the latest browser versions. Since most users have browsers that automatically update, we find this generally isn't an issue for deployed apps. I'd like to understand if your end users are actually impacted by this limitation or if this is just a test infrastructure issue.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView i/regression This issue described a confirmed regression on a currently supported version platform/android 🤖 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

7 participants