Gradle Build error after Unity update
Hello guys, I developed a game using Unity 2017.2.0f3 and built release version with Gradle. Later I tried to update to new version (2018.1.2f1). Game works fine in editor, but when I try to build, I get this error. I realized it might be because of some plugin I used, but there is not any information about "what plugin it is". I didn't find any plugin with name [id 'com.android.application']. Or could it be some generic plugin? I updated everything in Android SDK.
Thanks
Edit: Thanks for help, deleting of custom gradle file helped. Then I created new one and now its working.
Thanks CommandInvokationFailure: Gradle build failed. C:\Program Files\Java\jdk1.8.0_102\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2018.1.2f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\vrati_000\Programming\Work\Husky\projekt_husky4\Temp\gradleOut\build.gradle' line: 20
* What went wrong:
A problem occurred evaluating root project 'gradleOut'.
> Failed to apply plugin [id 'com.android.application']
> Gradle version 2.10 is required. Current version is 4.0.1. If using the gradle wrapper, try editing the distributionUrl in C:\Users\vrati_000\Programming\Work\Husky\projekt_husky4\Temp\gradleOut\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED in 15s
]
stdout[
Starting a Gradle Daemon (subsequent builds will be faster)
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1 progress, System.String error)
UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Hello, I am :) and I resolved it yesterday (deleted and created that gradle file again). But thanks bro ;)
Answer by wajdi1987 · Oct 15, 2018 at 10:27 PM
I have the same issue could you tell me how do you solve it ? @vratislavino