I updated the AndroidStudio to version 3.1
Clean Project...
and build failed
The SourceSet \'instrumentTest\' is not recognized by the Androi
instrumentTest has been deprecated and does not work with modern Gradle versions - which you probably updated in your project when upgrading Android Studio.
Replace instrumentTest with androidTest and it'll work.