-
Notifications
You must be signed in to change notification settings - Fork 526
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
[Mono.Android] fix trimming warnings, part 2 #8758
Merged
jonpryor
merged 6 commits into
dotnet:main
from
jonathanpeppers:Mono.Android-Trimming-Part-2
Mar 1, 2024
Merged
[Mono.Android] fix trimming warnings, part 2 #8758
jonpryor
merged 6 commits into
dotnet:main
from
jonathanpeppers:Mono.Android-Trimming-Part-2
Mar 1, 2024
Commits on Feb 23, 2024
-
[Mono.Android] fix trimming warnings, part 2
This fixes the next set of trimmer warnings found via: <IsTrimmable>true</IsTrimmable> <EnableAotAnalyzer>true</EnableAotAnalyzer> ~~ JavaObjectExtensions ~~ `JavaCast<T>()` now requires `PublicConstructors` and `NonPublicConstructors` because of `Activator.CreateInstance<T>()`. This change bubbles up to various other types that have a `Find*ById<T>()` method: * `Activity` * `Dialog` * `FragmentManager` * `View` * `Window` `GetInvokerType()` also has suppressions around `Assembly.GetType()` and `Type.MakeGenericType()`. We track this for the future at: dotnet#8724 ~~ AndroidRuntime ~~ Update `[DynamicallyAccessedMembers]` based on changes to `RegisterNativeMembers` in: dotnet/java-interop@b8f6f88 ~~ JNINativeWrapper ~~ `$(EnableAotAnalyzer)` found usage of `DynamicMethod`. Suppress for now, as we track this for the future at: dotnet#8724 ~~ ResourceIdManager ~~ Usage of `Type.GetMethod ("UpdateIdValues")` leads to decoration of `[ResourceDesignerAttribute]` with: [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] public string FullName { get; set; } I also had to suppress warnings around `Assembly.GetType()`. This *should* be OK, as `Resource.designer.cs` is always in the "root assembly" of Android application projects. ~~ JavaProxyThrowable ~~ Suppress warning around `StackFrame.GetMethod()`, we already handle null return values and exceptions. The existing code appears to be "best effort" to provide additional stack trace information. ~~ TypeManager ~~ Suppress warning around a call to `Type.GetType()` with a string passed in from Java. Not really much we can do yet, except rely on `MarkJavaObjects` trimmer step. Likely also a problem for the future: dotnet#8724
Configuration menu - View commit details
-
Copy full SHA for 2b6a0bf - Browse repository at this point
Copy the full SHA 2b6a0bfView commit details
Commits on Feb 26, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 991674c - Browse repository at this point
Copy the full SHA 991674cView commit details
Commits on Feb 27, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 6fab46c - Browse repository at this point
Copy the full SHA 6fab46cView commit details -
#pragma warning disable IL3050
Doing it this way, keeps the warning present if someone was attempting to *use* NativeAOT, they still get the warning.
Configuration menu - View commit details
-
Copy full SHA for 4234ebb - Browse repository at this point
Copy the full SHA 4234ebbView commit details
Commits on Feb 29, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 2f89efa - Browse repository at this point
Copy the full SHA 2f89efaView commit details -
Configuration menu - View commit details
-
Copy full SHA for c61f027 - Browse repository at this point
Copy the full SHA c61f027View commit details
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.