I have recently updated android studio and gradle to the version 3.0.0 following instructions in this link https://developer.android.com/studio/build/gradle-plugin-3-0-0-mig
Edit configurations -> Desktop -> In before launch change "Build" to "Build project". (use the + and - buttons).