-
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
XamlC: Maui android Release apk crash in .NET7 #18659
Comments
@jonathanpeppers thoughts? |
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
The problem here likely won't be addressed until this one is complete: For now, you should be able to use the trimmer settings to preserve:
Maybe something like this: <linker>
<assembly fullname="System.Private.CoreLib">
<type fullname="System.Char" preserve="methods" />
<type fullname="System.String" preserve="methods" />
</assembly>
</linker> |
I just tried to add
to the
But the error is the same Not sure if what I did is the correct way to setup the linker. As Linker Behaviour I have "Link SDK assemblies only" |
"Link SDK assemblies only" - yes, If you're not able to setup a precise trimmer rule to fix it, you could try something more heavy-handed: <ItemGroup>
<TrimmerRootAssembly Include="System.Private.CoreLib" />
</ItemGroup> This would just leave this one assembly alone -- leaving it untrimmed. |
Also this last attempt didn't solve the issue. Same error. I am using Visual Studio Mac 17.6.6 (build 408) if it helps. |
The stack trace is inside MAUI's The other thing to try is to disable trimming: |
Also with trimming disabled the app will crash
A regular binding would mean to replace the following from the ViewModel
With the following not in the ViewModel but in the .cs file?
The result is the same with the same error |
I thought removing usage of https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/data-binding/compiled-bindings So maybe the issue is not trimming, but XamlC? https://learn.microsoft.com/en-us/dotnet/maui/xaml/xamlc What happens if you put |
Allright, removing |
In my issue (below) I did not change trimming or try |
Description
The application works fine in debug mode, but when in Release the application crash.
The issue seems to be caused by indexed bindings in xaml
Click Go to days button for crash in Release mode, working fine in Debug.
Steps to Reproduce
Add any indexed string array binding in xaml?
Link to public reproduction project repository
https://github.com/davidchieregato/ReleaseCrash
Version with bug
7.0.101
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: