dotnet / java-interop

Java.Interop provides open-source bindings of Java's Java Native Interface (JNI) for use with .NET managed languages such as C#
Other
189 stars 48 forks source link

[Java.Interop.Tools.TypeNameMappings] introduce project for net8.0 #1199

Closed jonathanpeppers closed 4 months ago

jonathanpeppers commented 4 months ago

Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=9137456&view=logs&j=96fd57f5-f69e-53c7-3d47-f67e6cf9b93e&s=1afc3bfe-122c-538b-e9ad-2a86c2efcfef&t=38f83f46-bc21-5edd-1614-e44f20babf10&l=29658

xamarin/xamarin-android now has a random build failure:

"Xamarin.Android.sln" (default target) (1:2) ->
"src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj" (default target) (28:9) ->
(CoreCompile target) ->
    src/Xamarin.Android.Build.Tasks/Utilities/MamJsonParser.cs(92,43): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level [src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj]
    src/Xamarin.Android.Build.Tasks/Utilities/MamJsonParser.cs(92,81): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level [src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj]
    src/Xamarin.Android.Build.Tasks/Utilities/MavenExtensions.cs(26,32): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level [src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj]

It happens some percentage of the time... It appears the cause is the net8.0 Java.Interop.Tools.JavaCallableWrappers.dll is being used when the netstandard2.0 version should be used.

To fix this:

This partially reverts 67c079c and 56b7eeb.

jonathanpeppers commented 4 months ago

Testing this at: https://github.com/xamarin/xamarin-android/pull/8751