I had trouble with that, and an IntelliJ update to...
# gradle
a
I had trouble with that, and an IntelliJ update to 2018.1 did fix it for me. My experience was that it worked fine for Gradle command line/project import, just the editor on the settings file reported a spurious error- is that the case for you too?