Bug Issue: [Android Publication] Proxy setting ignored while downloading Gradle


Pages: 1

mdotedot

  • Subscriber - Stencyl Studio
  • *
November 06, 2018, 11:45:43 pm
(Windows 8.1 : Stencyl 10062)
When on a corporate network I need to use a proxy to compile/test my games.
Unfortunately the Android publication doesn't seem to use the proxy setting when downloading Gradle.
I've attempted to download it myself and put gradle on the path but it doesn't seem to check for gradle before downloading ?!?!

  generated dll=C:/Users/Administrator/AppData/Roaming/Stencyl/stencylworks/games-generated/ga/Export/android/obj/libApplicationMain-v7.so
2018-11-07 06:10:36,506 DEBUG [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]  - Copying file: Export/android/obj/libApplicationMain-v7.so -> Export/android/bin/app/src/main/jniLibs/armeabi-v7a/libApplicationMain.so
2018-11-07 06:10:36,584 DEBUG [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]  - Changing directory: Export/android/bin
2018-11-07 06:10:36,584 DEBUG [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]  - Running command: gradlew assembleDebug --info
2018-11-07 06:10:37,490 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe] Downloading http://services.gradle.org/distributions/gradle-2.10-bin.zip
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe] Exception in thread "main" java.net.ConnectException: Connection timed out: connect
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at java.net.Socket.connect(Socket.java:589)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at java.net.Socket.connect(Socket.java:538)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at sun.net.www.http.HttpClient.New(HttpClient.java:357)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
2018-11-07 06:10:58,689 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at org.gradle.wrapper.Download.download(Download.java:44)
2018-11-07 06:10:58,704 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at org.gradle.wrapper.Install$1.call(Install.java:61)
2018-11-07 06:10:58,704 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at org.gradle.wrapper.Install$1.call(Install.java:48)
2018-11-07 06:10:58,704 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
2018-11-07 06:10:58,704 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at org.gradle.wrapper.Install.createDist(Install.java:48)
2018-11-07 06:10:58,704 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
2018-11-07 06:10:58,704 INFO  [Thread-15] stencyl.sw.util.StreamGobbler: [haxelib.exe]    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
2018-11-07 06:10:58,736 DEBUG [pool-1-thread-2] stencyl.sw.util.Util: Process 'haxelib.exe' exited with code: 1
2018-11-07 06:10:58,736 ERROR [pool-1-thread-2] stencyl.sw.app.tasks.buildgame.GameBuilder: Failed: Running Android. (Return code: 1)
2018-11-07 06:10:58,751 ERROR [pool-1-thread-2] stencyl.sw.util.dg.MessageDialog: Encountered errors while building your game.: Check your logs and post them to the forums.  - Please describe what you have been doing. Be as specific as possible.



Gradle from the commandline:



C:\Users\Administrator>gradle
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reus
ed, use --status for details

> Task :help

Welcome to Gradle 4.6.

To run a build, run gradle <task> ...

To see a list of available tasks, run gradle tasks

To see a list of command-line options, run gradle --help

To see more detail about a task, run gradle help --task <task>

For troubleshooting, visit https://help.gradle.org


BUILD SUCCESSFUL in 25s
1 actionable task: 1 executed
<-------------> 0% WAITING
> IDLE

C:\Users\Administrator>gradle -version

------------------------------------------------------------
Gradle 4.6
------------------------------------------------------------

Build time:   2018-02-28 13:36:36 UTC
Revision:     8fa6ce7945b640e6168488e4417f9bb96e4ab46c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_181 (Oracle Corporation 25.181-b13)
OS:           Windows 8.1 6.3 amd64

C:\Users\Administrator>





Justin

  • Master Stencyler
  • *
November 11, 2018, 12:37:35 am
Regarding the proxy issue with gradle
Can you try adding this file to your Stencyl install and see if it works?

Code: [Select]
[stencyl]/plaf/lime-templates/android/template/gradle/wrapper/gradle-wrapper.properties
Code: [Select]
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-::ANDROID_GRADLE_VERSION::-bin.zip

## Proxy setup
systemProp.http.proxyUser=[PROXY_USERNAME]
systemProp.http.proxyPassword=[PROXY_PASSWORD]

systemProp.http.proxyHost=[PROXY_HOST]
systemProp.http.proxyPort=[PROXY_PORT]
systemProp.http.nonProxyHosts=localhost
systemProp.https.proxyHost=[PROXY_HOST]
systemProp.https.proxyPort=[PROXY_PORT]
systemProp.https.nonProxyHosts=localhost
## end of proxy setup

The folders after lime-templates will need to be manually added in the above path.

Replace the [PROXY_XXX] parts with the desired values.


If you want to try some more things, here's the StackOverflow question I grabbed the possible solution from.

https://stackoverflow.com/questions/8938994/gradlew-behind-a-proxy
  • Status changed from New to Need Info
« Last Edit: November 11, 2018, 12:37:03 am by Justin »


Justin

  • Master Stencyler
  • *
November 11, 2018, 04:05:18 am
Proxy settings should be honored now in b10066, though it's possible that it may still not work due to gradle bugs. Thanks for helping test this.
  • Status changed from Need Info to Resolved
  • Issue Assigned from (none) to Justin


mdotedot

  • Subscriber - Stencyl Studio
  • *
November 11, 2018, 09:11:13 am


Well almost there. There is now a gradle.properties in plaf\lime-templates\android\template
But the exported properties didn't had anything
I remove the if ... line
So this is there:
Code: [Select]

## Proxy setup
systemProp.http.proxyUser=::config.proxy.user::
systemProp.http.proxyPassword=::config.proxy.password::

systemProp.http.proxyHost=::config.proxy.host::
systemProp.http.proxyPort=::config.proxy.port::
systemProp.http.nonProxyHosts=localhost
systemProp.https.proxyHost=::config.proxy.host::
systemProp.https.proxyPort=::config.proxy.port::
systemProp.https.nonProxyHosts=localhost
## end of proxy setup



and then the result was that there were lines but NULL for proxy values
## Proxy setup
systemProp.http.proxyUser=null
systemProp.http.proxyPassword=null

systemProp.http.proxyHost=null
systemProp.http.proxyPort=null
systemProp.http.nonProxyHosts=localhost
systemProp.https.proxyHost=null
systemProp.https.proxyPort=null
systemProp.https.nonProxyHosts=localhost
## end of proxy setup


mdotedot

  • Subscriber - Stencyl Studio
  • *
November 12, 2018, 03:51:57 am
Confirmed Fixed in 10072 with and without username/password in preferences


Pages: 1

Details

  • Reported
    November 06, 2018, 11:45:43 pm
  • Updated
    November 12, 2018, 03:51:57 am

  • View Status
    Public
  • Type
    Bug
  • Status
    Resolved
  • Priority
    Normal
  • Version
    Stencyl 3.5
  • Fixed in
    (none)
  • Assigned to
    Justin
  • Category
    Compiling/Testing Games

Tags