I’m trying to setup an AndroidStudio build setup for jenkins, running on Ubuntu 16.04 behind a company firewall.
both gradlew (v. 3.3) and gradle binary zips (v. 3.3 and 4.1-rc1) all finally fail with this error messages for a minmal project in for traget “clean”:
running “gradle --offline” showed a new error message
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to find target with hash string 'android-17' in: /opt/android-sdk-26
which pointed to some install issue with sdk-26 because
so I’ve scratched and reinstalled sdk-26 and now – drum roll – gradle works fine and builds the sample project apk!!
still, without “–offline” I get those warnings
Warning: Failed to connect to host: https://dl.google.com/android/repository/addons_list-3.xml
Warning: Failed to connect to host: https://dl.google.com/android/repository/addons_list-2.xml
Warning: Failed to connect to host: https://dl.google.com/android/repository/addons_list-1.xml
Warning: Failed to download any source lists!
Warning: java.net.UnknownHostException: dl.google.com
I have the same kind of problem with SDK 24 and 25.
sdkmanager can update, but not the gradle plugin behind a proxy.
This is solved with gradle-plugin version 3.0.0-beta1 and later.
What look strange to me is that gradle picks up proxy options:
Picked up _JAVA_OPTIONS: -Dhttp.proxyHost=sample.localnet -Dhttp.proxyPort=80 -Dhttps.proxyHost=sample.localnet -Dhttps.proxyPort=80
Here are the system variables