Gradle build Fails on Unity 2019

I just upgraded my project to Unity 2019.1.1f and downloaded recommended SDK and NDK from Unity Hub.

Gradle used to work fine on my project until I upgraded my project to 2019. Here is what I am getting:

CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Hub\Editor\2019.1.1f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath “C:\Program Files\Unity\Hub\Editor\2019.1.1f1\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.
Where:
Build file ‘D:\HH_CASUAL!Repo_Shuriken\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.6. If using the gradle wrapper, try editing the distributionUrl in D:\HH_CASUAL!Repo_Shuriken\Temp\gradleOut\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip

My gradle template under Android folder is already mentioning 2.1.0:

  • buildscript {
    repositories {
    jcenter()
    }

      dependencies {
      	classpath 'com.android.tools.build:gradle:2.1.0'
      }
    

    }

    allprojects {
    repositories {
    flatDir {
    dirs ‘libs’
    }
    }
    }

With Unity 2019.1 installed Gradle 4.6 by default (via Unity Hub). Remove gradle template if you not using any scecific parameter. Or set 4.6 version in template.

Sorry for the late response, I had the same problem for a couple of months and I finally got around by installing the The Game Engine Manually from the Archives instead of the Hub and install the Android SDK from Android studios

Hi there i have the same problem with unity 2019.3.0f3. Gradle build failed. See the console for details.,Hi there i have the same problem with unity 2019.3.0f3 . Gradle build failed. See console for details.