Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Support Annotation does not exist after upgrading to Android Studio 3.0

Tags:

After I upgrade my project to AndroidStudio 3.0-beta1, my androidTest files stopped compiling.

A lot of packages are not found, some of them are:

error: package android.support.annotation does not exist
error: cannot find symbol class StringRes
error: cannot access AppCompatActivity
class file for android.support.v7.app.AppCompatActivity not found

I already added

androidTestCompile "com.android.support:support-annotations:25.3.1"

into build.gradle

But even with this, I have the errors of package not found. I tried running the tests from inside Android Studio and from terminal with ./gradlew connectedCheck

like image 760
jonathanrz Avatar asked Aug 11 '17 02:08

jonathanrz


People also ask

What is @supresslint?

@SuppressLint("NewApi") is an annotation used by the Android Lint tool. Lint will tell you whenever something in your code isn't optimal or may crash. By passing NewApi there, you're suppressing all warnings that would tell you if you're using any API introduced after your minSdkVersion.

What is annotate in Android?

Annotations allow you to provide hints to code inspections tools like Lint, to help detect these more subtle code problems. They are added as metadata tags that you attach to variables, parameters, and return values to inspect method return values, passed parameters, local variables, and fields.


1 Answers

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'
like image 183
Napster Scofield Avatar answered Oct 19 '22 09:10

Napster Scofield