android studio errors about 'android.annotation.NonNull' in handler.java

Viewed 322

I am using Android Studio Arctic Fox(2020.3.1). I've been having some trouble with handler.java Most of the errors are

'android.annotation.NonNull' is not public in 'android.annotation'. Cannot be accessed from an outside package

I've tried to fix android with androidx. but I don't know why this error occurs. please help me.

enter image description here

2 Answers

I guess you need to import androidx.annotation.Nullable and make sure you have declared a dependency on androidx.annotation:annotation in your build.gradle, check here to find the last version.

that's not important!

you will get these kinds of errors when navigating android source.

that won't affect your android project and everything will be compiled successfully ✔

Related