So I got an error from Playstore that I need to set Target SDK to at least 30. I installed the SDK in android studio, set the path in the Unity preferences. But when I build it fails with error: Code (CSharp): Could not determine the dependencies of task ':launcher:bundleReleaseResources'. > Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager. From what I read build tool 31 is not supported with the default gradle version of Unity 2020. I see in the gradle a line Code (CSharp): buildToolsVersion '**BUILDTOOLS**' But not sure where BUILDTOOLS is set. I tried to change the line manually to Code (CSharp): buildToolsVersion '30.0.3' In the mainTemplate.gradle But I still get the same error! why would it still use tools version 31? What is the supported way to build to Playstore using Unity 2020?
If you want to delete API 31, Go to Unity's Android SDK Installation path and delete following folders 1. platforms/android-31 folder 2. build-tools/31.x.x folder
Thanks! deleting this worked (I did try to delete it before but somehow it got re-installed) I still wonder why it used build tools 31 when the gradle states 30.0.3 Also I would still like to find how to change BUILDTOOLS from unity settings instead of having to manually change the gradle file.
Unity replaces the BUILDTOOLS value runtime when exporting. I don't know a way to force it other than changing the Automatic option for Target Api. How did you find out that its still using 31 tools?