Can't build Flutter apps behind corporate proxy


I'm having trouble building Android Flutter apps behind my organisation's proxy server on Windows. Flutter installed correctly and flutter doctor reports no issues. I've got my http_ and https_proxy environment variables set. I'm using VS Code for development but have Android Studio installed. The Android emulator runs correctly and VS Code can see it when it's running.

Telling VS Code to debug the main.dart of the default template application results in GradleW trying to download a version of Gradle and creating .part and .lck files with sizes of 0kb, then failing with the errors:

java.security.NoSuchAlgorithmException
[snip]
Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation
[snip]
Caused by: java.security.KeyManagementException: problem accessing trust store

Reading around the internet it seems the "problem accessing trust store" is the root of the issue; the self-signed certificate for my organisation's proxy server being unavailable. However my gradle.properties looks like this:

systemProp.http.proxyHost=[correct server]
systemProp.http.proxyPort=[correct port]
systemProp.http.proxyUser=[correct user]
systemProp.http.proxyPassword=[correct password]
systemProp.http.nonProxyHosts=*.jitpack.io, *.maven.org, [our domain]

systemProp.https.proxyHost=[correct server]
systemProp.https.proxyPort=[correct port]
systemProp.https.proxyUser=[correct user]
systemProp.https.proxyPassword=[correct password]
systemProp.https.nonProxyHosts=*.jitpack.io, *.maven.org, [our domain]

systemProp.javax.net.ssl.trustStore=NUL
systemProp.javax.net.ssl.trustStoreType=Windows-ROOT

systemProp.jdk.http.auth.tunneling.disabledSchemes=""

So I seem to have the correct settings to allow Java, Flutter, and the Gradle Wrapper to see our proxy and certificate store. What do I need to change to get it to download Gradle correctly?

1
Feb 20 at 10:16 AM
User AvatarDan Price
#java#android#flutter#gradle#proxy

No answer found for this question yet.