I upgraded my Android project to Unity 2019.1.1f and trying to make build but getting errors.
What I have done so far:
Updated my gradle template version as “classpath ‘com.android.tools.build:gradle:3.2.0’” same as under Editor\Data\PlaybackEngines\AndroidPlayer\Tools\GradleTemplates
Added google() and jcenter() in template under repositories
Installed SDK and NDK from Unity hub as reccomended
I am getting following errors:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project ‘gradleOut’.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Similar problem, but started with clean simple Android project using 2019.1.8f1.
“…Failure: Gradle initialization failed.”
“IOException: Win32 IO returned 1224…”
and one more?
Tried: Under Publisher Settings > Build, clicked: “Custom Gradle Template” which reduced the number of errors from 15 to the above.
For me, it’s just a clean install of 2019.2 with the android SDK stuff built-in. Make a cube and try to build. Spent a whole day screwing around with it…trying different solutions from the internet. I’m thinking now…just re-install it without the built-in android SDK…do it manually…at least then I can see what’s what.
Update: I had to uninstall/reinstall Unity and opt to not Install the built-in android-related SDKs. Instead downloaded all that stuff manually (Android SDK, JDK, NDK, Gradle)…now I can build. I’d prefer the built-in solution, because it’s a lot of moving parts but only if it works 100.0% of the time without exception. I was enjoying this in 2019.1, but with 2019.2 looks like I’m going back to manual SDK management.
If you have a custom gradle template and you are using newer Unity version than 2019.1.7f1, then Android gradle plugin version 3.4 is required. Since gradle template could have changed significantly compared to when you have created it, you should recreate the template with your current Unity version and then do similar modifications that you’ve done before.