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.

Android Hybrid Template throws exception

See original GitHub issue

ran

dotnet new -i Microsoft.MobileBlazorBindings.Templates::0.5.50-preview
dotnet new blazorhybrid -o FirstBlazorHybridApp

and then ran the android project and got this image

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jspuijcommented, Nov 24, 2020

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.

1reaction
skclusivecommented, Nov 17, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

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