-
Notifications
You must be signed in to change notification settings - Fork 571
[TrimmableTypeMap] Skip unresolvable trimmable typemap peers #11751
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
Merged
simonrozsival
merged 12 commits into
dotnet:main
from
simonrozsival:android-trimmable-unresolvable-peers
Jun 30, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8e35c68
Skip unresolvable trimmable typemap peers
simonrozsival f94e326
Add XA4256 scanner regression test
simonrozsival 3e36986
Use platform-neutral XA4256 test paths
simonrozsival 9d89350
Use collection expressions in XA4256 tests
simonrozsival e7eaed4
Address XA4256 scanner review feedback
simonrozsival b1dd9b2
Fix XA4256 test data accessibility
simonrozsival 6d6786b
Fix CS8506 build break in XA4256 test
simonrozsival 68e675e
Key trimmable typemap resolvability cache by type handle
simonrozsival fe5df64
Add XA4256 negative tests: unscanned ref and type-forwarding
simonrozsival 6b6a838
Walk generic constraints in resolvability check; reuse visited set
simonrozsival 8ed77f6
Merge remote-tracking branch 'origin/main' into android-trimmable-unr…
simonrozsival 8ff2ca5
Renumber XA4256 -> XA4257 after merge (main took XA4256)
simonrozsival File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| title: .NET for Android warning XA4256 | ||
| description: XA4256 warning code | ||
| ms.date: 06/25/2026 | ||
| f1_keywords: | ||
| - "XA4256" | ||
| --- | ||
|
|
||
| # .NET for Android warning XA4256 | ||
|
|
||
| ## Example message | ||
|
|
||
| ``` | ||
| warning XA4256: Skipping Java peer type 'Google.Android.Material.Shadow.ShadowDrawableWrapper' from assembly 'Xamarin.Google.Android.Material' because referenced type 'AndroidX.AppCompat.Graphics.Drawable.DrawableWrapper' from assembly 'Xamarin.AndroidX.AppCompat.AppCompatResources' could not be resolved in '/home/user/.nuget/packages/xamarin.androidx.appcompat.appcompatresources/1.6.0/lib/net6.0-android31.0/Xamarin.AndroidX.AppCompat.AppCompatResources.dll'. This type will not be included in the trimmable type map. | ||
| ``` | ||
|
|
||
| ## Issue | ||
|
|
||
| The trimmable type map found a Java peer type whose managed base type or implemented interface references a type that is not present in the resolved assembly set. | ||
|
|
||
| This can happen when NuGet packages in the Android binding graph were built against different versions of another binding package. The type may be unused by the app, but NativeAOT compiles a closed world and must resolve rooted managed types eagerly. | ||
|
|
||
| ## Solution | ||
|
|
||
| If your app uses the skipped type, update the affected NuGet packages so the referenced type exists, or update to versions of the binding packages that are compatible with each other. | ||
|
|
||
| If your app does not use the skipped type, no action is required. The type is omitted from the trimmable type map so NativeAOT does not fail while resolving unused stale metadata. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.