Build Apk failed cocos2d-js project

Build Apk failed cocos2d-js project
0

I’m new in Cocos2d-js, I try to build an example cocos2d-js project create by cocos console and get this error. Someone help me out this problem? Thanks.

  • cosos2s-x 3.17.2
  • android-ndk-r19c
  • Android Studio 3.5 for MacOs
JohnDaniels-MacBook-Pro:MyGame johndaniel$ cocos compile -p Android

Python 2.7.10

Building mode: debug

Using Android Studio project : /Users/hamala/MyGame/frameworks/runtime-src/proj.android

Building apk...

running: '"/Users/hamala/MyGame/frameworks/runtime-src/proj.android/gradlew" --parallel --info assembleDebug -PPROP_BUILD_TYPE=cmake -PPROP_COMPILE_SCRIPT=0'

Downloading https://services.gradle.org/distributions/gradle-5.4.1-all.zip

Exception in thread "main" java.lang.RuntimeException: java.net.SocketException: Reply from SOCKS server has bad version

at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)

at org.gradle.wrapper.Install.createDist(Install.java:47)

at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)

at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)

Caused by: java.net.SocketException: Reply from SOCKS server has bad version

at java.net.SocksSocketImpl.connectV4(SocksSocketImpl.java:285)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:467)

at java.net.Socket.connect(Socket.java:589)

at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:673)

at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)

at sun.net.NetworkClient.doConnect(NetworkClient.java:180)

at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)

at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)

at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)

at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)

at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:200)

at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1175)

at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)

at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)

at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)

at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)

at org.gradle.wrapper.Download.downloadInternal(Download.java:59)

at org.gradle.wrapper.Download.download(Download.java:45)

at org.gradle.wrapper.Install$1.call(Install.java:60)

at org.gradle.wrapper.Install$1.call(Install.java:47)

at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)

And run on Android Studio