Search Issue Tracker

Fixed in Unity 2018.2

Votes

13

Found in

2018.1.0a2

Issue ID

1093946

Regression

Yes

[Android][Gradle] Build fails when downloading files from jcenter

Mobile

-

-

Priority: 2Necessary for shipping a final release

-

Severity: 3Secondary functionality broken

Steps to repoduce:
1. Delete ',gradle' folder from %USERPROFILE% folder
2. Create a new project
3. Attempt to build an apk

Reproduced on: 2018.2.0a1, 2018.2.14f1, 2018.3.0b7, 2019,.1.0a6
Not reproducible on: 2017.4.14f1, 2018.1.9f2

Error:
A problem occurred configuring root project 'gradleOut'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.3.1/aapt2-proto-0.3.1.jar

Workaround: Create a custom 'mainTemplate'gradle' file and reorder 'repositories' of 'buildscript' and 'allprojects' so that 'jcenter' is not on top.
To create a custom template file go to Player Settings > Publishing Settings > Build > Custom Gradle Template

Comments (4)

  1. Ffe6f06b22cebbef449c7d80399cdad8?d=mm

    daniel-hall

    Oct 25, 2018 14:05

    For anyone needing to use cloud build with plugins in the meantime before the official fix, I got it working like this:

    https://forum.unity.com/threads/builds-started-failing-in-2-projects-ive-been-changing-with-could-not-find-intellij-core-jar.573055/#post-3820144

  2. 28feeb032f61946eb8c62caff5d099ca?d=mm

    calebbbarton

    Oct 25, 2018 00:14

    This also occurs on 2018.2.5f1

  3. A6aee2da1db49268dfd22861b301b67b?d=mm

    migs_pixi

    Oct 24, 2018 21:29

    Also it's quite impossible to override the template for other plugins on the Mac...

  4. 04d12d67e22735489d0189f8b887ad46?d=mm

    NamekGames

    Oct 24, 2018 21:16

    Yeah, thats great, but the workaround doesn't work when other plugins are present and generating their own gradle files.

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.