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, 9.0 Preview 5] Release configuration build results in a malfunctioning app (Preview 5 debug and Preview 4 release configurations work fine). #9115

Closed
janne-hmp opened this issue Jul 4, 2024 · 8 comments
Assignees
Labels
Area: App Runtime Issues in `libmonodroid.so`. need-attention A xamarin-android contributor needs to review

Comments

@janne-hmp
Copy link

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

@janne-hmp
Copy link
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?

@samhouts samhouts transferred this issue from dotnet/maui Jul 16, 2024
@dotnet-policy-service dotnet-policy-service bot added the needs-triage Issues that need to be assigned. label Jul 16, 2024
@jpobst
Copy link
Contributor

jpobst commented Jul 17, 2024

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

@janne-hmp
Copy link
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.

@jpobst
Copy link
Contributor

jpobst commented Jul 17, 2024

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!

@jpobst jpobst reopened this Jul 17, 2024
@jpobst jpobst added Area: App Runtime Issues in `libmonodroid.so`. and removed needs-triage Issues that need to be assigned. labels Jul 17, 2024
@grendello
Copy link
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!

@grendello grendello added the need-info Issues that need more information from the author. label Jul 18, 2024
@janne-hmp
Copy link
Author

Here you go:

logcat.zip

@dotnet-policy-service dotnet-policy-service bot added need-attention A xamarin-android contributor needs to review and removed need-info Issues that need more information from the author. labels Jul 18, 2024
@grendello
Copy link
Contributor

@janne-hmp thank you!

@janne-hmp
Copy link
Author

This seems to be now fixed in Preview 7.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App Runtime Issues in `libmonodroid.so`. need-attention A xamarin-android contributor needs to review
Projects
None yet
Development

No branches or pull requests

3 participants