Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#1,558 0 commenti 1 reazione 2 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@jonathanpeppers ci sta già lavorando.

Dal 10/10/2026.

  • #1559 di @copilot-swe-agent — chiusa senza merge

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
40/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
android, csharp
Ambito
mobile

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
C#
Stelle
319
Fork
73
Merge medio
2g 11h
PR unite (30g)
8

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dotnet/android-libraries

Tutte le issue di dotnet/android-libraries

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.