For .NET 10, we should update the dotnet new android template so that $(SupportedOSPlatformVersion) is 24, bumping from the current default of 21.
The reason for this is that "desugaring" "moves" Java methods to locations that we don't expect, which can result in AbstractMethodErrors at runtime. Setting the minimum SDK version to >= 24 avoids this desugaring step, preventing the Java methods from being moved in a manner we don't expect, and thus avoiding the AbstractMethodError.
Note that 21 will still be the supported minimum for those that need it, however this will keep most users who do not need to support devices that old from having desugaring issues.
Context: https://github.com/dotnet/android-libraries/issues/767 Context: https://github.com/dotnet/android-libraries/issues/767#issuecomment-2448729455
For .NET 10, we should update the
dotnet new android
template so that$(SupportedOSPlatformVersion)
is 24, bumping from the current default of 21.The reason for this is that "desugaring" "moves" Java methods to locations that we don't expect, which can result in
AbstractMethodError
s at runtime. Setting the minimum SDK version to >= 24 avoids this desugaring step, preventing the Java methods from being moved in a manner we don't expect, and thus avoiding theAbstractMethodError
.Note that 21 will still be the supported minimum for those that need it, however this will keep most users who do not need to support devices that old from having desugaring issues.