Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Regression: incorrect nullability annotations in Xamarin.AndroidX.AppCompat 1.8.0

Abierto
#1,558 0 comentarios 1 reacción 2 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

@jonathanpeppers ya está trabajando en esto.

Desde el 10/10/2026.

  • #1559 de @copilot-swe-agent — cerrado sin fusionar

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
40/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
android, csharp
Área
mobile

Línea de trabajo

Start from the reproduction: a new androidlib project referencing Xamarin.AndroidX.AppCompat 1.8.0, where AlertDialog.Builder(null!).Create() emits CS8600 but 1.7.1.4 does not. Compare the nullability annotations on the Java-bound members between the two versions, and check the same for Fragment.GetString. Done means the warnings disappear on 1.8.0 and the annotations match the Java source. The fix probably lives in binding metadata, so the maintainers' guidance on where that lives matters before editing.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Android framework version

net10.0-android

Affected platform version

.NET 10.0.400

Description

Xamarin.AndroidX.AppCompat used to have correct C# nullability annotations in version 1.7.1.4, but they're gone in version 1.8.0, resulting in numerous build warnings.

This is not an isolated incident; A similar regression exists for the latest version of AndroidX.Fragment.App (e.g. in Fragment.GetString). My guess is the nullable annotations are not being properly bound from Java.

Steps to Reproduce
  1. Create a project:
dotnet new androidlib
dotnet package add '[email protected]'
  1. Add the following code:
public class Class1
{
    public void X()
    {
        AndroidX.AppCompat.App.AlertDialog dialog = new AndroidX.AppCompat.App.AlertDialog.Builder(null!).Create();
        //  Code is valid because the return value of Create() is non-null
    }
}
  1. dotnet build and observe the build warnings:
Class1.cs(9,53): warning CS8600: Converting null literal or possible null value to non-nullable type.
  1. Downgrade to 1.7.1.4 and observe the warnings are gone
Did you find any workaround?

No response

Relevant log output

Lenguaje dominante
C#
Estrellas
319
Forks
73
Merge medio
2 d 11 h
PR fusionados (30 d)
8

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de dotnet/android-libraries

Todos los issues de dotnet/android-libraries

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.