Issues building for android 2020.3

Please help, I have two separate projects both with the same issues after upgrading from 2019.4 LTS to 2020.3 LTS. When building I get the following gradle error:

Do you use custom gradle files, theyā€™re might be not compatible with 2020.

Hi Tomas,

No I donā€™t use custom gradle files. I just installed 2020.3 LTS through Unity Hub, then changed the projects Unity version to that. Let the upgrade process ā€œdo itā€™s stuffā€, then tried building for android and instantly got a gradle error.

These are the publishing settings from my player settings:
6977918--823094--upload_2021-3-26_15-52-37.png

I assume this means it uses whatever .gradle templates exist as default?

My External tools settings are:

6977918--823097--upload_2021-3-26_15-54-40.png

Any ideas would be really great, I tried reverting to 2019.4 but get lots of script errors, which I assume was caused by the upgrade process so now I am stuck not being able to build my .apk.

It is worth noting that I have two android projects which have this issue and they were working in 2019.4 so itā€™s not an isolated case.

Thanks

Try this - select Export Project

  • Export Project with your upgraded game with 2020.3
  • Create Empty project with 2020.3, export project

Compare gradle files between two exports, maybe it will help you spot an error

Hi, sorry I donā€™t see an option for export project other than exporting it as a package?

I also tried opening a brand new URP project from Unity Hub and trying to build for Android, same issue is happening. I also found a bug report yesterday which seemed slightly related. It is a shame this occurring in an LTS version. It is preventing me from testing recent changes to my app.

Please provide more information on the export project option.

Hereā€™s the export project option

Thanks for this, I will give it a go but I am guessing that because Empty Project, URP Project and Oculus project I have still donā€™t build itā€™s either a bug or something with my machine. I have another machine I can try just to see if there .gradle is different there.

Thanks for your help.

For future readers, I managed to get Unity 2020.3 building the same projects on another machine, which told me something was wrong with my local set up. I managed to find some rogue gradle folders inside C:\Users{Username}. I removed these folders, but the build still didnā€™t work. I then uninstalled all versions of Unity which I had installed in hub. Restarted my machine, re-installed only 2020.3 and the build began working again.

Not sure if the rogue gradle files were somehow the issue but at least the build is working now.

Thanks for the help Tomas1856. Your export idea helped me get a grasp on things.

2 Likes