Skip to content
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

[nativeaot] run Mono.Android-Tests #9846

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jonathanpeppers
Copy link
Member

This is WIP, it doesn't even build quite yet.

This is WIP, it doesn't even *build* quite yet.
@jonathanpeppers jonathanpeppers mentioned this pull request Feb 24, 2025
10 tasks
jonathanpeppers added a commit to dotnet/java-interop that referenced this pull request Feb 25, 2025
Context: dotnet/android#9846

When trying to build `Mono.Android-Tests` for NativeAOT, I get many
warnings like this (that are upgraded to errors):

    src\Java.Interop.GenericMarshaler\Java.Interop.GenericMarshaler\JniPeerInstanceMethodsExtensions.cs(10874,17):
    error IL2091: 'T' generic argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.NonPublicConstructors' in 'Java.Interop.JniRuntime.JniValueManager.GetValueMarshaler<T>()'. The generic parameter 'T16' of 'Java.Interop.GenericMarshaler.JniPeerInstanceMethodsExtensions.InvokeGenericVirtualObjectMethod<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(JniInstanceMethods, String, IJavaPeerable, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
    Build failed with 2992 error(s) in 4.8s

To solve this here, we can import:

    <Import Project="..\..\build-tools\trim-analyzers\trim-analyzers.props" />

To see all the warnings *here*, and then I added the missing
attributes to solve the warnings.
jonpryor pushed a commit to dotnet/java-interop that referenced this pull request Feb 26, 2025
Context: dotnet/android#9846

When trying to build `Mono.Android-Tests` for NativeAOT, I get many
warnings like this (that are upgraded to errors):

	src\Java.Interop.GenericMarshaler\Java.Interop.GenericMarshaler\JniPeerInstanceMethodsExtensions.cs(10874,17):
	error IL2091: 'T' generic argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.NonPublicConstructors' in 'Java.Interop.JniRuntime.JniValueManager.GetValueMarshaler<T>()'. The generic parameter 'T16' of 'Java.Interop.GenericMarshaler.JniPeerInstanceMethodsExtensions.InvokeGenericVirtualObjectMethod<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(JniInstanceMethods, String, IJavaPeerable, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
	Build failed with 2992 error(s) in 4.8s

To solve this here, we can import:

	<Import Project="..\..\build-tools\trim-analyzers\trim-analyzers.props" />

To see all the warnings *here*, and then I added the missing
attributes to solve the warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant