A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
Thanks for reaching out.
From my research, this behavior is likely a package compatibility issue introduced after moving to .NET 10 for Android. The platform bindings already include the Android annotation types, but Plugin.Firebase 4.2.1 is still bringing in Xamarin.GoogleAndroid.Annotations transitively.
As a result, the build ends up with two different assemblies attempting to generate the same Java types, which leads to the XA4215 errors you’re seeing.
A good first step is to keep Plugin.Firebase in place and try excluding the transitive annotations package from the Android build. You can do that by adding an explicit reference in your .csproj like this:
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<PackageReference Include="Xamarin.GoogleAndroid.Annotations"
Version="1.0.0"
ExcludeAssets="all"
PrivateAssets="all" />
</ItemGroup>
After applying that, clear any cached artifacts and rebuild to make sure the previous resolution isn’t reused:
dotnet nuget locals all --clear
dotnet clean
dotnet restore
dotnet build -f net10.0-android
If you want to confirm where the package is coming from, you can run:
dotnet list package --include-transitive
That should show Xamarin.GoogleAndroid.Annotations being pulled in through Plugin.Firebase or one of its dependencies.
If excluding the package alone doesn’t resolve it, the next thing to check is whether there are newer versions of Plugin.Firebase or its Firebase/AndroidX dependencies that are aligned with .NET 10. In many cases, updating to compatible versions resolves these duplicate binding issues more cleanly than workarounds.
As a fallback, it’s also possible to remove the conflicting assembly at build time via a custom MSBuild step, but that approach is more fragile and typically only used when dependency alignment isn’t possible.
Given your deadline, I would start with the exclusion approach since it’s low impact and quick to validate, then look at dependency updates if the issue persists. I wouldn’t recommend removing Plugin.Firebase unless these options don’t resolve the conflict, as that would require reworking your push notification implementation.
Hope this helps! If my answer was helpful, I would greatly appreciate it if you could follow the instructions here so others with the same problem can benefit as well.