Nothing preserves an assembly reference, if no C# types are used directly #9008
Labels
Area: App+Library Build
Issues when building Library projects or Application projects.
bug
Component does not function as intended.
Milestone
Android framework version
net8.0-android, net9.0-android
Affected platform version
.NET 9
Description
Context:
$(AndroidHttpClientHandlerType)
#8954In the above PR, I had to add a class named
Foo
and use it for theCustomWidgetTests
to succeed.The situation is:
AndroidResource
.xml filePossible Solution
I suppose we could do something that would support passing all Android class libraries to the trimmer. Even ones that the C# compiler deems is unused?
We'd then rely on the trimmer to do its job to remove unused code.
Steps to Reproduce
Foo.cs
from the changes in [trimming] preserve custom views and$(AndroidHttpClientHandlerType)
#8954Release
modeDid you find any workaround?
Reference some C# class, such as
Foo
or even the previous code would work:Relevant log output
Mentioned in 9a782d7.
Xamarin.Android.RuntimeTests.CustomWidgetTests
failed with:In this case,
Mono.Android_Test.Library.CustomTextView
was usedfrom an Android layout, but not used anywhere in managed code.
The text was updated successfully, but these errors were encountered: