Skip to content

[regression/8.0.0] Android app crashes with an ANR on .NET 8 preview 6 #16418

Closed
@jmezach

Description

@jmezach

Description

We are experiencing an issue with a cross-platform app we are developing that is being killed by Android due to an Application Not Responding (ANR). So far we haven't been able to pinpoint what is causing this, but we figured we'd report this anyway since it appears not to happen with .NET 7, only with .NET 8. That being said, we do have a workaround which is removing the <GoogleServicesJson> element from the project file, but that then means we are unable to receive push notifications in our app which we obviously do actually need.

So it seems that there is some combination of factors that are contributing to this issue but we don't think it is something that is actually happening in our code. We can however consistently reproduce the issue. What is further complicating things is that it only seems to happen when the app is running on a device and has been compiled in Release mode.

We do have an ANR report from a device but it is too big to post here. What would be the best way to provide this information?

Steps to Reproduce

  1. Create a .NET MAUI Android app targeting .NET 8
  2. Add push notification support to the app through Firebase
  3. See the app crash with an ANR
  4. Notice that this does not happen when targeting .NET 7

Please note that our provided repro doesn't actually crash with an ANR, that only happens in our actual app, but we can't figure out what the difference is. Our working assumption is that in our actual app some process that is running in the background is taking up a lot of time and that causes the app to crash.

Link to public reproduction project repository

https://github.com/tristanhollman/MauiApp_FirebaseMessagingNet8

Version with bug

8.0.0-preview.5.8529

Last version that worked well

7.0.86

Affected platforms

Android

Affected platform versions

At least Android 13, might occur on older versions as well but haven't tested

Did you find any workaround?

A workaround is to remove the <GoogleServiceJson> element from the project file, but then push notifications no longer work.

Relevant log output

We do have an ANR report from a device, but it is too big to place here. Please let us know how we can provide this information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    externali/regressionThis issue described a confirmed regression on a currently supported versionpartner/androidIssues for the Android SDKplatform/androids/needs-attentionIssue has more information and needs another lookt/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions