Android Hybrid Template throws exception
See original GitHub issueran
dotnet new -i Microsoft.MobileBlazorBindings.Templates::0.5.50-preview
dotnet new blazorhybrid -o FirstBlazorHybridApp
and then ran the android project and got this

Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Android Hybrid Template throws exception · Issue #224
No changes at all in the project, or did anything change after you created the initial template?
Read more >Blazor Hybrid ElementReferenceJsonConverter throw an ...
The error only appears while debugging. On first load it does show the index page very briefly before erroring. android · visual-studio ·...
Read more >I'm trying blazor Hybrid for the first time and using a local ...
I'm trying blazor Hybrid for the first time and using a local android device. How can I get more details of the error...
Read more >Hybrid Framework in Selenium
Learn about the fundamentals of Hybrid framework in Selenium along ... args) throws Exception { //Declaring the path of the Excel file with ......
Read more >Spring RestTemplate Error Handling
Throw an exception that is meaningful to our application; Simply ignore the HTTP status and let the response flow continue without interruption.
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 Free
Top 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

I’m pretty sure it has got to do with the fact that somehow on some platforms a newer version of System.Memory is pulled in from nuget instead of from the framework (it should pickup the framework version. I.E. the mono or .net core versions, never the nuget). The nuget version does not contain the new Span<T> and Memory<T> types that System.Text.Json needs.
We add a package reference to each android project through the props files inside the nuget with the right version and IncludeAssets=“none” to fix this. This works for visual studio and cmdline builds.
https://github.com/xamarin/MobileBlazorBindings/blob/master/src/Microsoft.MobileBlazorBindings.WebView.Android/build/Microsoft.MobileBlazorBindings.WebView.Android.props#L12-L14
However I get a feeling that with other IDEs than visual studio 2019 for windows this does not work, which would mean that an application configuration file with the right binding redirects would need to be generated (or be made by you).
What sometimes also works is removing the reference to System.Memory inside the project file if it uses old style references with hint paths.
i get the same error with the same steps with newly created project for Andriod only. using Visual Studio Mac.
please share if there are any workaround available. thanks.