Skip to content

[Android, 9.0 Preview 5] Release configuration build results in a malfunctioning app (Preview 5 debug and Preview 4 release configurations work fine). #9115

Description

@janne-hmp

Description

In release mode in Preview 5 in Android, the app malfunctions (hangs up on opening almost any page). Debug configuration in Preview 5 works fine, as does Release configuration in Preview 4. Tested with both dotnet CLI and Visual Studio 17.11.0 Preview 2.1.

Steps to Reproduce

Build GnollHackM in Release configuration for Android using .NET MAUI 9.0 Preview 5.

Link to public reproduction project repository

https://github.com/hyvanmielenpelit/GnollHack

Version with bug

Unknown/Other

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

9.0.0-preview.4.10690

Affected platforms

Android

Affected platform versions

Android 14

Did you find any workaround?

No, the build is just somehow weirdly corrupted in Preview 5 Release configuration.

Relevant log output

No response

Activity

  1. janne-hmp commented on Jul 10, 2024

    @janne-hmp
    Author

    The app still malfunctions in Preview 6, like in Preview 5. There are most likely some (possibly widget appearance) files missing from the apk, since the outlook of e.g. switches on the main page is different from Debug version of the app. Preview 4 works fine. Does anybody know any workarounds I could try rather than just going back to Preview 4 every time I need to build a release version for Android, since all debug versions and iOS and Windows release version work fine in Preview 5 and 6?

  2. transferred this issue fromdotnet/mauion Jul 16, 2024
  3. jpobst commented on Jul 17, 2024

    @jpobst
    Contributor

    Does setting <AndroidEnableMarshalMethods>false</AndroidEnableMarshalMethods> in your .csproj fix the issue?

  4. janne-hmp commented on Jul 17, 2024

    @janne-hmp
    Author

    Yes, it does indeed! Thanks a lot. @jonathanpeppers Seems like AndroidEnableMarshalMethods is not working properly at the moment in .NET MAUI 9.0 Preview 6.

  5. deleted a comment from github-actions on Jul 17, 2024
  6. jpobst commented on Jul 17, 2024

    @jpobst
    Contributor

    I'm gonna reopen this one for now to let @grendello look at it. We are trying to only enable this feature for scenarios that it works, so we should investigate why it is failing for this case.

    Thanks for the report!

  7. reopened this on Jul 17, 2024
  8. added and removed
    needs-triageIssues that need to be assigned.
    on Jul 17, 2024
  9. grendello commented on Jul 18, 2024

    @grendello
    Contributor

    @janne-hmp would you mind recording the hang event? Your app is a large project and I'm not sure when I'll have time to devote due attention to investigating the issue. Logcat output might be very helpful, here's how to record it:

    1. Build and deploy your application as usual, but don't start it yet.
    2. Issue the following commands from the VS Developer Prompt:
    > adb logcat -G 65M
    > adb shell setprop debug.mono.log default,assembly,timing=bare,mono_log_level=debug,mono_log_mask=all
    > adb logcat -c
    rem Start the application here, wait for it to hang/crash, then wait 10s more and:
    > adb logcat -d > logcat.txt

    Then attach the resulting logcat.txt file here, thanks!

  10. added
    need-infoIssues that need more information from the author.
    on Jul 18, 2024
  11. janne-hmp commented on Jul 18, 2024

    @janne-hmp
    Author

    Here you go:

    logcat.zip

  12. added
    need-attentionA xamarin-android contributor needs to review
    and removed
    need-infoIssues that need more information from the author.
    on Jul 18, 2024
  13. grendello commented on Jul 18, 2024

    @grendello
    Contributor

    @janne-hmp thank you!

  14. janne-hmp commented on Aug 16, 2024

    @janne-hmp
    Author

    This seems to be now fixed in Preview 7.

  15. locked and limited conversation to collaborators on Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area: App RuntimeIssues in `libmonodroid.so`.need-attentionA xamarin-android contributor needs to review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions