skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. 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 ✔

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search