Gradle Build failed to connect on CI server (Teamcity)

Gradle failure report

[16:48:26] [Gradle failure report] FAILURE: Build failed with an exception.

[16:48:26] [Gradle failure report]

[16:48:26] [Gradle failure report] * What went wrong:

[16:48:26] [Gradle failure report] A problem occurred configuring root project ‘93517f998ad0ea0e’.

[16:48:26] [Gradle failure report] > Could not resolve all artifacts for configuration ‘:classpath’.

[16:48:26] [Gradle failure report] > Could not resolve com.android.tools.build:gradle:3.2.1.

[16:48:26] [Gradle failure report] Required by:

[16:48:26] [Gradle failure report] project :

[16:48:26] [Gradle failure report] > Could not resolve com.android.tools.build:gradle:3.2.1.

[16:48:26] [Gradle failure report] > Could not get resource ‘https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom’.

[16:48:26] [Gradle failure report] > Could not GET ‘https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom’.

[16:48:26] [Gradle failure report] > Connect to dl.google.com:443 [dl.google.com/172.217.166.238] failed: Connection refused: connect

[16:48:26] [Gradle failure report]

[16:48:26] [Gradle failure report] * Try:

[16:48:26] [Gradle failure report] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

[16:48:26] [Gradle failure report]

[16:48:26] [Gradle failure report] * Get more help at https://help.gradle.org

[16:48:26] [Gradle failure report]

[16:48:26] [Gradle failure report] BUILD FAILED in 8s