當我嘗試為 Android 構建 Unity 專案時,它報告“Gradle build failed”。我嘗試使用 VPN 并使用另一個存盤庫(位于 Gradle 連接無法正常作業的中國),但仍然出現相同的錯誤。
我檢查了日志(見下文),其中一行顯示它嘗試“連接到 192.168.1.4:1125 [/192.168.1.4]”,這似乎很可疑。我的建筑 PC 是 192.168.1.2,它直接連接到光纖調制解調器,即 192.168.1.1。192.168.1.4是另一個連接到光纖調制解調器的wifi調制解調器,它應該與我的PC的互聯網連接無關。
為什么 Unity 在構建 Gradle 時會嘗試連接不相關的設備?有關如何解決此建筑故障的任何建議?謝謝!
A problem occurred configuring project ':launcher'.
> Could not resolve all artifacts for configuration ':launcher:classpath'.
> Could not resolve com.android.tools.build:gradle:4.0.1.
Required by:
project :launcher
> Could not resolve com.android.tools.build:gradle:4.0.1.
> Could not get resource '404'.
> Could not GET '404'.
> Connect to 192.168.1.4:1125 [/192.168.1.4] failed: Connection timed out: connect
修改后的baseProjectTemplate:

uj5u.com熱心網友回復:
我已經解決了。在“C:\Users\xxx\.gradle”找到“gradle.properties”檔案,注釋掉systemProp.xxxx,如下所示:

轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/410699.html
標籤:
