Closed gabriel-kozma closed 2 months ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Hi,
The AOT stuff is pretty glitched, try adding
<RunAOTCompilation>False</RunAOTCompilation>
to your .csproj for Android release builds, e.g.
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-android|AnyCPU'">
<RunAOTCompilation>False</RunAOTCompilation>
</PropertyGroup>
Hi,
The AOT stuff is pretty glitched, try adding
<RunAOTCompilation>False</RunAOTCompilation>
to your .csproj for Android release builds, e.g.
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-android|AnyCPU'"> <RunAOTCompilation>False</RunAOTCompilation> </PropertyGroup>
The problem is, I need aot, I've waited to update to maui from Xamarin, since IL stripping didn't work on maui and with .net 8 they've added support
Just tried without AOT and still crashes
Maybe it's not AOT then - but you mentioned IL stripping - maybe something there is being too aggressive? Maybe post your settings w.r.t. any IL stripping that's taking place.
it was a combination of
I'm encountering the same issue; disabling AOT didn't resolve it. I urgently need to create a release build. Is there a workaround available?
It appears that dependency injection fails to work as expected in release mode; it crashes when a parameterless constructor is absent.
It appears that dependency injection fails to work as expected in release mode; it crashes when a parameterless constructor is absent.
Have you figured out a workaround?
@jonathanpeppers thoughts?
In the end, the error was due to an incorrect definition in my XAML. The issue was that the actual error wasn't displayed anywhere. Correcting the XAML resolved the issue with Dependency Injection.
There is a lack of information here, to know what went wrong.
@gabriel-kozma said:
it was a combination of and IL stripping, is there a way to control IL removing?
What was the setting that worked vs didn't work?
There is an issue related to the experimental $(AndroidStripILAfterAOT)
setting, that should be fixed in .NET 9 now:
hi @jonathanpeppers just using IL stripping causes the app to crash, I could try the .net 9, but I would need to wait for production to release it?
Can this be back ported to .net 8?
I'll try here and report back
You could comment on https://github.com/dotnet/runtime/pull/103975 and ask if it is going back to .NET 8.
Thank you @jonathanpeppers is there a way for me to add more logging in order to figure out how is breaking?
I followed what @wagenheimer said and started looking, I'm not using XAML anymore, but I've had some code comments with the Xamarin.Forms xaml and it was this that was causing the problem with IL Stripping
another question I have @jonathanpeppers is were the empty dlls are stored on the release application? In xamarin they were stored at a file monodroidbundle which cointaned all dlls and I could verify that they were indeed stripped of their IL
On Android, .NET assemblies are compressed into a single file that can be mmap
'd in one call.
You can use either of these tools to inspect or pull them out of an .apk
:
Is this issue good to close now? Thanks!
No response, so I assume its good to close!
Description
My app is crashing when I run the app built with release
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
8.0.61 SR6.1
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