question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blazor startup not working on Android

See original GitHub issue

Description

Based on the documentation in order to call C# backend from BlazorWebView we must wait for Blazor initialization. On Windows mode it is working as expected. But on Android the following exception is thrown:

[chromium] [INFO:CONSOLE(1)] "Uncaught (in promise) TypeError: window.external.receiveMessage is not a function", source: https://0.0.0.0/_framework/blazor.webview.js (1)
[chromium] [INFO:CONSOLE(1)] "Uncaught (in promise) Error: Blazor has already started.", source: https://0.0.0.0/_framework/blazor.webview.js (1)

Please fix it as the MAUI is not working on Android. So at least I am not able to start the app as in my case a call to backend is required on startup.

Steps to Reproduce

  1. Clone the repo: https://github.com/fairking/MauiApp1.git
  2. Open the project in VS
  3. Run in Windows Mode, you will see the following message: “Hello World OK!”
  4. Now run in Android Mode, you will see the following message: “Loading…” and VS output will log the errors mentioned in the description above.

Version with bug

6.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 9.0

Did you find any workaround?

No 😦

Relevant log output

[chromium] [INFO:CONSOLE(1)] "Uncaught (in promise) TypeError: window.external.receiveMessage is not a function", source: https://0.0.0.0/_framework/blazor.webview.js (1)
[chromium] [INFO:CONSOLE(1)] "Uncaught (in promise) Error: Blazor has already started.", source: https://0.0.0.0/_framework/blazor.webview.js (1)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:32 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
fairkingcommented, Jun 14, 2022

Thank you guys for the help and the explanation. Please allow me to look at the docs and do the homework first. Ones I got it running I will close the ticket. I believe I won’t have any more questions. FYI @Eilon @TanayParikh

1reaction
fairkingcommented, May 23, 2023

Thank you guys for all your help and support 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blazor MAUI app crashes on start in Release config ...
I have written a .NET MAUI Blazor app and have run into an issue where it is now crashing as soon as the...
Read more >
How to fix your MAUI Blazor app crashing on startup with ...
This article explains how to fix your Blazor Hybrid MAUI application (built with Blazor Webassembly, using MAUI to build & publish for multiple ......
Read more >
Blazor Hybrid slow/janky startup? Goes from app ...
FWIW I'm working on a Blazor Hybrid App myself and loading (splash screen > index.razor) is pretty seemless in the Android Emulator.
Read more >
Walkthrough: Build your first app with Mobile Blazor Bindings
In Solution Explorer, right-click on the Android or iOS project and select Set as StartUp Project . Set startup project in Solution Explorer....
Read more >
Blazor Hybrid Web Apps with .NET MAUI
MAUI uses a single shared code-base to run on Android, iOS, macOS, and Windows, ... Bringing Blazor to the desktop isn't a new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found