Remote build fails to resolve 'services.gradle.org'

I was able to put right incantations in place and make Gradle pick up proxy available in environment.

Leaving my solution if anyone ever gets stuck on this:

https_proxy_host=$(echo $https_proxy | cut -d'/' -f3 | cut -d':' -f1)
https_proxy_port=$(echo $https_proxy | cut -d'/' -f3 | cut -d':' -f2)
gradle_opts="-Dhttp.proxyHost=$https_proxy_host -Dhttp.proxyPort=$https_proxy_port -Dhttps.proxyHost=$https_proxy_host -Dhttps.proxyPort=$https_proxy_port"

gradle $gradle_opts assemble
3 Likes