Error:Unknown host services.gradle.org. You may need to adjust the proxy settings in Gradle
Go to..
File > Settings > Appearance & Behavior > System Settings > HTTP Proxy Enable following option Auto-detect proxy settings
and press checkConnection button for test
In my case issue occurred after following:
I selected proxy settings from Android Studio settings when I was working in a network behind a proxy. When I disconnected from that network and connected to home network which doesn't have a proxy, I removed the proxy settings from Android Studio, but gradle seemed to take the old proxy settings.
The problem was that gradle had also saved the proxy settings in following file when I set proxy settings in Android Studio, but it hasn't got removed when I removed proxy settings from Android Studio.
%HOME%\.gradle\gradle.properties
When I removed the proxy settings from this file, gradle sync worked again.
Update your project level build.gradle to latest version - it works for me
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'