I recently updated Android Studio. Afterwards it seems to no longer being able to resolve some support annotations, such as @NonNull
or @Nullable
. It did work just fine before updating. However, everything is still compiling and I am able to execute Code, but still it shows the symbol cannot be resolved message at my imports.
What I have already tried so far:
Included the dependency in build.gradle (Module: Application):
compile 'com.android.support:support-annotations:27.0.0'
I have no idea why this is not working and would really appreciate your help.
As of android api 29 ('targetSdkVersion' 29) com.android.support has been moved to 'androidx' library.
In your build.gradle
file(app level), dependencies block use...
dependencies{ ... implementation 'androidx.annotation:annotation:1.1.0' }
And in your .java
files use import as follows:
import androidx.annotation.NonNull;
Again build your project!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With