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

.aidl can produce C# NRT warnings #6686

Open
jonathanpeppers opened this issue Jan 28, 2022 · 1 comment
Open

.aidl can produce C# NRT warnings #6686

jonathanpeppers opened this issue Jan 28, 2022 · 1 comment
Labels
Area: Bindings Issues in Java Library Binding projects.

Comments

@jonathanpeppers
Copy link
Member

This sample: https://github.com/xamarin/monodroid-samples/tree/dotnet/AIDLDemo

Produces build warnings:

obj\Debug\net6.0-android\aidl\IAdditionService.cs(38,27): warning CS8765: Nullability of type of parameter 'reply' doesn't match overridden member (possibly because of nullability attributes). 

Line is:

protected override bool OnTransact (int code, global::Android.OS.Parcel data, global::Android.OS.Parcel reply, int flags)
obj\Debug\net6.0-android\aidl\IAdditionService.cs(26,12): warning CS8603: Possible null reference return.
obj\Debug\net6.0-android\aidl\IAdditionService.cs(27,14): warning CS8600: Converting null literal or possible null value to non-nullable type.

Lines are:

public static Com.Xamarin.Aidldemo.IAdditionService AsInterface (global::Android.OS.IBinder obj)
{
	if (obj == null)
		return null;
@jonathanpeppers jonathanpeppers transferred this issue from dotnet/java-interop Jan 28, 2022
@jonathanpeppers jonathanpeppers added the Area: Bindings Issues in Java Library Binding projects. label Jan 28, 2022
@jonathanpeppers jonathanpeppers added this to the Under Consideration milestone Jan 28, 2022
@jpobst
Copy link
Contributor

jpobst commented Oct 20, 2022

Related to dotnet/java-interop#1052, we should probably mark these files as "auto-generated". As a side effect, Roslyn will disable NRT warnings in autogenerated files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Bindings Issues in Java Library Binding projects.
Projects
None yet
Development

No branches or pull requests

2 participants