-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[8.0.0-preview.5.8529] [Android] DeviceSensors produce an ANR at irregular intervals when built in Release mode. #15829
Comments
This issue occurred as early as Microsoft Visual Studio 17.6 and inexplicably flashed back, |
Just confirmed that the issue is present in preview 6 as well. |
Hi @lordstyx. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
I'm not sure what happened, but just like you're showing in your screenshot, the Location feature of the Extended Controls in my Emulator has broken. The map in both the Single Point and Routes tab doesn't show, and I can't load a saved route, nor import an externally created route. I've attached a test route either way, but the emulator might also not load it for you as well. You can however just run the app on a local device, and walk around for a bit. After a few location updates, the app also crashes as described. [Edit]: I seem to get it more quickly when I change the location permission from "Allowed only while in use" to "Allowed all the time". |
Yeah, I can't get the routes to work in the emulator either. It just spins forever loading the file... So, I tried on my Pixel 5 device, but the app also seems to be working. I think you could enable Mono's tracing and the runtime will log every method called: # clear the log
adb logcat -c
# enable tracing
adb shell setprop debug.mono.trace all
# run the app again, cause an ANR
# save the log
adb logcat -d > log.txt You should see lines like this:
The class that looks questionable to me is Tracing will make the app very slow. To clear this later you can either reboot the device or run |
Hi @lordstyx. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
I was able to produce such a log with an ANR, the dump starts at timestamp 08-22 00:53:17.166. As to your comment about To reproduce on my real device, I need to receive about three location updates, which requires me to walk ~50m. |
I had the app running on a Pixel 5 and drove around the block, and it was working? I'll look into your logs tomorrow, thanks. One difference, is I'm using dotnet/maui/net8.0 branch and all the versions here, so these are nightly RC 1 builds of everything: https://github.com/dotnet/maui/blob/net8.0/eng/Version.Details.xml |
Hmm, it appears the last managed method is about 10 seconds from the ANR:
So, it's in native code/runtime side where things are stuck. Somewhere in @lordstyx are you using .NET 8 Preview 7? We disabled a feature in Can you try the latest release? Or set |
I had so far still been using preview 6, from when originally reporting the issue. In our actual app we also notice a big reduction in ANR's when building with preview 7, but they're not completely gone. Thank you. |
Description
In an app we collect device sensor data, such as geolocation, connectivity status and battery info.
Trying out .NET 8-preview 5 because it has an event-based Geolocation sensor implementation (see #9572), we notice that, when the app is built in Release mode, the interface randomly freezes and produces an ANR.
Steps to Reproduce
This happens both on the emulator as on actual devices.
The problem can be reproduced with the sample app.
These interactions will freeze the application, leading to an ANR shortly.
Link to public reproduction project repository
https://github.com/lordstyx/MauiAndroidDeviceSensorAnr
Version with bug
8.0.0-preview.3.8149
8.0.0-preview.4.8333
8.0.0-preview.5.8529
8.0.0-preview.6.8686
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 8 and up.
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: