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:
- Go into the Player Settings
- Under Publishing Settings tick the box for Custom Gradle Template (Unity then creates a build.gradle template for you)
- The template is in Assets > Plugins > Android > mainTemplate.gradle
- Open that file in something like Notepad
Change ONLY THIS:
repositories { jcenter() google() }
torepositories { google() jcenter() }
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.
- Go to the
.gradle folder
(default is underC:\Users\<name>\
). - Create a file called
gradle.properties
under this folder. - 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
- Reopen unity and build !