Description
Context: dotnet/android-libraries#1136
Context: https://developer.android.com/jetpack/androidx/releases/core#1.16.0
In version 1.16
of AndroidX "core", Google switched from using their androidx.annotation.NonNull
types to new "industry-standard" "JSpecify nullness annotations". (Documentation)
Because generator
does not support these annotations, all types that were previously "not-null" now appear to be "nullable".
We will need to extend generator
to understand these new annotations to generate correct NRT code, as this is potentially just the beginning of Google migrating the entire AndroidX ecosystem to use them.
Note that these new annotations appear more complex than what we currently support, as you can mark a module/package/class/method as @NullMarked
which means all types in that scope are considered "not-null" unless otherwise annotated. Scopes below a @NullMarked
scope can additionally be marked as @NullUnmarked
which undoes @NullMarked
for the annotated scope.