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
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
to
solves the issue.