I updated to Android Studio 3.1 and as suggested by Android Studio also:
in your gradle-wrapper.properties, try using:
distributionUrl=https://services.gradle.org/distributions/gradle-4.3-rc-2-all.zip