Support Annotation does not exist after upgrading to Android Studio 3.0

In my case it happened after migrating to androidX . The decision merely was :

go to the *.java file(s) pointed and comment strings with packages

 //import android.???

and re-import androidX-ed ones.

Build the project again and you are done.


Just add this to your dependencies

implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation "com.android.support:support-annotations:28.0.0"
annotationProcessor 'com.android.support:support-annotations:28.0.0'

Try this:

import androidx.annotation.StringRes

I had the same problem. The issue is not that you upgraded AndroidStudio but that your target version and compile version are below 26 after updating the build tools in your SDK.

So changing

android {
    compileSdkVersion 25

    defaultConfig {
        applicationId "bla.bla"
        minSdkVersion 21
        targetSdkVersion 25
    }
}

to

android {
    compileSdkVersion 26

    defaultConfig {
        applicationId "bla.bla"
        minSdkVersion 21
        targetSdkVersion 26
    }
}

solves the issue.