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

[Bug] .NET MAUI Blazor App crashed on physical device #3060

Closed
RaspeR87 opened this issue Oct 21, 2021 · 7 comments
Closed

[Bug] .NET MAUI Blazor App crashed on physical device #3060

RaspeR87 opened this issue Oct 21, 2021 · 7 comments
Assignees
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView t/bug Something isn't working

Comments

@RaspeR87
Copy link

Description

If I build empty .NET MAUI Blazor App (Preview) VS template with command dotnet build -f net6.0-android -c Release and then install .apk file into one of the physical Android 10 Phone and then run it, it always crash after startup.

So the point is that I want to create .apk for my Blazor MAUI project, which could be send to some phones to test it.

If I try same process with empty .NET MAUI App (Preview) and same command dotnet build -f net6.0-android -c Release it works well on physical Android Phone.

I think there is a problem with some Blazor component or something. Because of that I try to clear all blazor stuff (script include blazor.webview.js etc.) inside index.html file and leave only this inside it:

<!DOCTYPE html>
<html>
<head>
</head>

<body>
    Živjo!
</body>

</html>

But this doesn't help. Screen attached below is shown just for one second and then app crashed.
Screenshot_20211021_130820_com huawei android launcher

Steps to Reproduce

  1. Create default .NET MAUI Blazor App Visual Studio template
  2. run command dotnet build -f net6.0-android -c Release
  3. Copy .apk from "bin/Release/net6.0-android" folder
  4. install it into some physical Android phone
  5. run it

Expected Behavior

Run without problem like .NET MAUI App template.

Actual Behavior

App is crashing all time.

Basic Information

  • Version with issue: MAUI P9
  • Last known good version:
  • IDE: VS 2022 P6
  • Platform Target Frameworks:
    • Android: API 29
@RaspeR87 RaspeR87 added the t/bug Something isn't working label Oct 21, 2021
@jsuarezruiz jsuarezruiz added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Oct 21, 2021
@aokocax
Copy link

aokocax commented Oct 22, 2021

Hello #2246 (comment)

@RaspeR87
Copy link
Author

Hello #2246 (comment)

@aokocax you save my day!!! :-)

I also added just <AndroidLinkMode>None</AndroidLinkMode> and it works like a charm on release mode on physical Android phone :-)

So that case could be closed.

@CutAndDry
Copy link

the <AndroidLinkMode>None</AndroidLinkMode> fix dident work for me untill I restarted my Visual studio so if any one else is trying this and its not working they might have to do the same

took me way to long to find this out
thank you
image

@SteveSandersonMS
Copy link
Member

I've been trying to investigate this, and I do get a crash in the Android emulator in release builds. It looks as if this may be coming from something deeper in MAUI rather than BlazorWebView, so have filed #4262. If it is a BlazorWebView issue, we'll need help understanding how to track down which .NET code might be involved, since the error trace isn't about .NET at all but rather is phrased in terms of Java code.

Until there is a response to #4262 I can't take other action, so am going to reschedule this issue for the next preview.

@soundaranbu
Copy link

Same problem when I tried the .NET Podcast app. I'm updating the issues that I faced here
microsoft/dotnet-podcasts#30

@danroth27
Copy link
Member

@SteveSandersonMS Now that #4262 is resolved and closed, should this be closed as well? Or is there more to do here?

@SteveSandersonMS
Copy link
Member

Yes let's close it.

@ghost ghost locked as resolved and limited conversation to collaborators Mar 12, 2022
@mkArtakMSFT mkArtakMSFT added this to the 6.0.300-preview.14 milestone Mar 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants