Gradle build for Android in Unity fails, saying that it could not find intellij-core.jar

Here's what worked for me, as reported here:

  1. Go into the Player Settings
  2. Under Publishing Settings tick the box for Custom Gradle Template (Unity then creates a build.gradle template for you)
  3. The template is in Assets > Plugins > Android > mainTemplate.gradle
  4. Open that file in something like Notepad
  5. Change ONLY THIS:

    repositories { jcenter() google() } to repositories { google() jcenter() }

  6. Save the file then try the build again. Not a perfect solution but it should work until Unity/Android fixes the issue. I'm not sure whether this can become undone by upgrading Unity, but I do know that it has to be done per project.


Here's the only solution that worked for me since I'm behind a proxy.

  1. Go to the .gradle folder (default is under C:\Users\<name>\).
  2. Create a file called gradle.properties under this folder.
  3. Add the following:

#http proxy setup
systemProp.http.proxyHost=<your proxy URL>
systemProp.http.proxyPort=<your proxy Port>
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost

#https proxy setup
systemProp.https.proxyHost=<your proxy URL>
systemProp.https.proxyPort=<your proxy Port>
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost
  1. Reopen unity and build !