-
Notifications
You must be signed in to change notification settings - Fork 527
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
[net6] Enabling ILLink on the root assembly causes the build to fail on Application attribute #7301
Comments
Trimming the main assembly (root assembly) would probably break in lots of ways. Is there an app size reduction you're going after here? Do you have some numbers you can share? |
Trimming used to be supported with Xamarin (afaik) and with all the code generators out there, lots of code is generated without necessarily being used ( That being said, the feature I'm mostly interested in activating for the root assembly is ILLink "substitutions" and the root assembly mode is "copy" by default, preventing features to be conditionally enabled/disabled as a result. In the case of Uno, activating this allows us to cut in half the size of the app on WebAssembly (because we're generating lots of code). By the nature of string-based switches, the ILLinker cannot work properly so we use a combination of substitution and linking to achieve that. |
With Xamarin.Android, we never linked the main assembly since it was the entry point which controlled what was used everywhere else. We would also loose things like BroadcastRecievers etc since they would never be used in code and only from the Manifest. At least thats how it used to work. |
I'm facing the same issue when testing net9-pre3, while everything works with net8. |
The issue here is filed along with .NET 6. It may no longer be relevant. The issue you have might be quite different, if you are opting into Can you file a new issue with a |
Yes, I'm using |
Android application type
Android for .NET (net6.0-android, etc.)
Affected platform version
17.4 Preview 1
Description
When building with the root assembly enabled for linking, the build fails with the following:
caused by :
https://github.com/xamarin/xamarin-android/blob/10b972063f6253c232bad784d702c22dfb381a91/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/PreserveApplications.cs#L99
Which is expecting specific parameters values to be present, even if those are optional.
Steps to Reproduce
Did you find any workaround?
Add empty parameters to the
Application
attribute:Update: It's actually not a workaround since it fails later on:
Relevant log output
No response
The text was updated successfully, but these errors were encountered: