COCOS编译打包需要远程下载gradle-4.10.3-all.zip,这个远程地址需要科学上网,获取不到就会出现以下报错:(gradle-4.10.3-all.zip获取地址看文章附件)
编译模式:release 使用 Android Studio 工程:D:\games\TYHY_P\NewProject\build\jsb-default\frameworks\runtime-src\proj.android-studio 正在生成 apk 文件... 正在执行:'"D:\games\TYHY_P\NewProject\build\jsb-default\frameworks\runtime-src\proj.android-studio\gradlew.bat" --parallel --info assembleRelease' Downloading https://services.gradle.org/distributions/gradle-4.10.3-all.zip Exception in thread "main" java.lang.RuntimeException: java.net.ConnectException: Connection timed out: connect 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.ConnectException: Connection timed out: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668) 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:191) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1138) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177) at sun.net.www.protocol.http.HttpURLConnection.followRedirect0(HttpURLConnection.java:2701) at sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2623) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1806) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254) 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) ... 3 more 执行命令出错,返回值:1。
安装方法:
1、下载gradle-4.10.3-all.zip
在文章附件
2、修改复制
下载完成以后,打开:C:\Users\admin.gradle\wrapper\dists\gradle-4.10.3-all (一般是这个地址),打开gradle-4.10.3-all文件夹,会发现一个长串数字组成的文件夹:
打开这个文件夹 ,里面通常会有两个文件:
将.part的文件后缀改成.ok, 再把gradle-4.10.3-all.zip放进去,解压:
注意:解压后不要删除压缩包,在这里插入图片描述到此操作完成。
3、测试
重新编译正常:
注意:
如果你还用as下载过gradle,那么在.gradle\wrapper\dists\目录中会有二个文件,它们两个不共用。比如:
附件地址:
附件为gradle-4.10.3-all.zip,评论可见!
- 1、下载gradle-4.10.3-all.zip
- 2、修改复制
- 3、测试
发表评论
123
111
sss
好文章
好文章
1
1
111
000
0.0
000