Blazor startup not working on Android
See original GitHub issueDescription
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
- Clone the repo: https://github.com/fairking/MauiApp1.git
- Open the project in VS
- Run in Windows Mode, you will see the following message: “Hello World OK!”
- 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:
- Created a year ago
- Comments:32 (17 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
Thank you guys for all your help and support 👍