I am getting error after updating the version of Android Studio 3.1 Canary 6
I don\'t why its happen, before that it\'s running successfully.
This worked for me!
App/build.gradle
//Add this....Keep both version same
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }