- Home /
How to fix Gradle build error when building android apk?
CommandInvokationFailure: Gradle build failed. C:/Program Files/Java/jdk1.8.0_172\bin\java.exe -classpath "C:\Program Files\Unity(2018.3.5)\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
-
Could not resolve all artifacts for configuration ':classpath'. Could not resolve com.android.tools.build:gradle:3.2.0.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 3s ] stdout[
]
I have this problem too, please help i think it is internet connection problem but how and where
i used vpn, proxy, nothing and any other way but the error continues
Same issue in 2019.10f2. I posted a question but it's still in moderation. Have you had any response on this @polham30?
Same issue.,Same issue, using 2019.10f2.l. Any solution?
Answer by polham30 · Jul 03, 2019 at 06:12 AM
Hi, everyone! I fixed this issue. I tried upgrade windows os. After then gradle build error was removed.
Answer by DragonGyke · Jul 02, 2019 at 09:06 PM
Same issue in 2019.1.3. Btw, i think this is not a network issue, because when i access the link in the log in browser, the .pom file could be downloaded successfully.
Answer by sajjadgameactor · Feb 26, 2020 at 08:37 PM
I had the same error and after two day I found the solution. Go to C:\Users\YOURUSERNAME.gradle you should see a file named gradle.properties in this file gradle proxy can be set. for example in my case i have this configuration:
systemProp.http.proxyHost=127.0.0.1
systemProp.https.proxyPort=53556
systemProp.https.proxyHost=127.0.0.1
systemProp.http.proxyPort=53556
for more infromation about how to configure this file you can check here: https://docs.gradle.org/current/userguide/build_environment.html
I uploaded an image of how to configure gradle.properties here: https://imgur.com/a/Z2vemkD
Your answer
![](https://koobas.hobune.stream/wayback/20220612195241im_/https://answers.unity.com/themes/thub/images/avi.jpg)