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

Android crashes after about 5 seconds[Bug] #1361

Closed
gviddy opened this issue Jun 18, 2021 · 15 comments
Closed

Android crashes after about 5 seconds[Bug] #1361

gviddy opened this issue Jun 18, 2021 · 15 comments

Comments

@gviddy
Copy link

gviddy commented Jun 18, 2021

Description

Downloaded Visual Studio 2019 Preview 2 and upgraded to Maui Preview 5. Create and run an Android app on the emulator and it loads into the default click button app. After about 5 seconds the app crashes with nothing interesting in the logs. This did not occur using VS Preview 1 and Maui Preview 4.

Steps to Reproduce

  1. Install Visual Studio Preview 2
  2. Install Maui Preview 5
  3. Create the default MAUI solution in Visual Studio
  4. Build all
  5. Run on Android emulator
  6. See the default app load, click the button to increase the counter or do nothing.
  7. After 5 seconds the app will crash.

Expected Behavior

The app does not crash. It did not do this in the previous preview.

Actual Behavior

The app crashes with nothing interesting to see in the debug window.

maui-check says everything is ok.

@gviddy
Copy link
Author

gviddy commented Jun 18, 2021

Work around, does not crash if I run from the command line.

dotnet build -t:Run -f net6.0-android

@matt-goldman
Copy link
Contributor

matt-goldman commented Jun 18, 2021

I get this too. I think it's a debugger issue, the last lines in the output are:

[] * Assertion at /__w/1/s/src/mono/mono/mini/debugger-engine.c:1088, condition `found_sp' not met
[libc] Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 26347 (.NET ThreadPool), pid 26311 ([my app name but missing the first two letters for some reason])

@matt-goldman
Copy link
Contributor

@gviddy is the workaround working ok for you? If I run from the command line it builds but doesn't run. Workaround for me has been waiting for it to crash and then just launching it again on the emulator. Not ideal as I can't debug but at least it runs.

@ncarandini
Copy link

Try to disable XAML Hot Reload:
image

@matt-goldman
Copy link
Contributor

@ncarandini great tip! Worked for me, thanks.

@GaryGormley
Copy link

@ncarandini Worked for me as well. Also solved issue #1260, remote calls to API now working.

@gviddy
Copy link
Author

gviddy commented Jun 20, 2021

Agree with Gary above, turning off XAML Hot Reload stops crashing. Thanks for discovering this.

@MaxxDelusional
Copy link

Disabling hot reload fixed it for me too. The weird thing is, I was working on my app for about an hour before the issue started to occur.

@jirisykora83
Copy link

This workaround does not work 100%. It just make it work some time but even with disabled Hot Reload it still start crashing. In current state it is almost impossible work with anything else then simple hello world demo. Also because of RCL (most likely) it is not possible to use WinUI. I like this project but from last few days trying to work with i am just really frustrate with current tooling i hope it gets better soon.

[] * Assertion at /__w/1/s/src/mono/mono/mini/debugger-agent.c:4389, condition tls' not met`

@PaulSorauer-IPG
Copy link

This workaround does not work 100%. It just make it work some time but even with disabled Hot Reload it still start crashing. In current state it is almost impossible work with anything else then simple hello world demo. Also because of RCL (most likely) it is not possible to use WinUI. I like this project but from last few days trying to work with i am just really frustrate with current tooling i hope it gets better soon.

[] * Assertion at /__w/1/s/src/mono/mono/mini/debugger-agent.c:4389, condition tls' not met`

Yes, I've disabled Hot Reloading but am now fairly consistently getting the same (2nd) error as @jirisykora83 . 'Tis strange, as I too initially had it working fine with Hot Reloading enabled.

@PaulSorauer-IPG
Copy link

Anecdotally, (or at least the couple of times I've just tried it), removing "net6.0-maccatalyst" (and having already removed "net6.0-ios" because I don't currently have a physical iPhone to hand), and then setting the build configuration to explicitly target x86, does seem to allow the app to deploy and run successfully to the Android emulator. Still need to have the Hot Reload switched off but at least it's kinda working.

@jfversluis
Copy link
Member

Seems that this was mostly resolved and also applies to older previews. Hope this all is fixed, if not, please open an issue with all the new details. Thanks!

@bricefriha
Copy link

Try to disable XAML Hot Reload:
image

You can also untick just HotReload for MAUI, in case you're like me and you still want to use it for Xamarin Forms
image

(I know it makes sense but I'm saying it anyways 😂)

@Phil4121
Copy link

I am facing the same issue with Preview 10 and VS 2022 Preview. Disable Hot Reload does't fix it too.
Also turning off Mobile Data causes the same issue

@paaltuv
Copy link

paaltuv commented Jan 14, 2022

I'm also seeing this on Preview 10. I had a solution that worked before the upgrade to 10, but after the upgrade needs to have xaml hot reload disabled

@ghost ghost locked as resolved and limited conversation to collaborators Feb 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests