What went wrong:
A problem occurred configuring root project ‘gradleOut’.
Failed to find Build Tools revision 29.0.0
I have no idea why Unity would choose revision 29.0.0 as Build Tools revision.
I have 28.0.3 installed and worked fine for a long time. How to change this revision?
The reason, why Unity would choose 29.0.0, is that there is a folder named “29.0.0-rc1” in the “Android\Sdk\platforms”. The stupid Unity framework detected the newest revision was 29.0.0-rc1, but it only accepts revision like 2x.x.x. So it wrote revision 29.0.0 to “build.gradle” file.
In the player settings, my selection of the target API level is not “the Highest installed”, but Android 9(28). It seems this selection means nothing to the gradle result.
By the way, the revision “29.0.0-rc1” was automatically installed by Android Studio. You will never know when your silly Unity will get into this trap.
Best to have android ndk and sdk for unity separate from the one used for Android Studio. I kept running into this problem at least once a year when AndroidStudio updates the SDK to a point where Unity can’t handle it anymore.
You can pick your own folders via Preferences → External tools
simply remove the “29.0.0-rc1” folder from your build tools directory.
exported your project, and change the property value of buildToolsVersion to “29.0.0-rc1” or any revision installed. buildToolsVersion is inside the “build.gradle” file.
Thanks @StartStart and @luoyu510183 for the tips needed to resolve this. I decided to do it a slightly cleaner way by removing -rc2 build tools using Android Studio:
Android Studio > Tools > SDK Manager
Choose the SDK Tools tab
Unselect the Build Tools and hit Apply; this will remove all of your build tools
Tick Show Package Details and then choose the latest version with x.y.z; for me this was 28.0.3
Hit Apply; this will download the proper build tools
Perform the Unity build; should finish successfully!
This thread was immensely helpful. Thank you all.
For anyone else reading, another option is to uninstall all of the build tools using the SDK Manager and then run Unity. It will complain that there is no SDK and offer to install it. I chose the normal install (not “highest available”) and it finally worked.
I update my android studio and sdk, also update unity to 2019.1.0f2. Now it’s giving build gradle error. In my build-tools folder their are 2 file.
One is 28.0.3
Second is 29.0.0-rc2
A problem occurred configuring root project ‘gradleOut’.
You can just delete the folder “29.0.0-rc2”. It’s not a final released version anyway. Also, Unity 2019.1.0.f2 has embedded the Android SDK. You can just set “Android SDK installed with Unity” in the Preferences window.
Thanks for replay. When I delete 29.0.0-rc2 folder. Unity give me panel to update the android studio or select highest available sdk. The reason I update the sdk is because google ads not showing. When I delete 29.0.0-rc2 folder the .apk file is generate successfully but ads not showing. Can you help me with it. It’s almost more than 2 week that I face this problem.
After read all post about this, simple, how i use unreal 4 too, i had did the update “sdk base”, “platfoorm tools” and “build tools” by codeworks nvidia , then, here i finded folder 29.0.0-rc2 on build tools folder, dont delete or remove then, i must only update the 3 components
I don’t think it’s a good idea to upgrade your Android SDK to the highest version just for ads issue. On the one hand, google ads not showing might be caused by permission issues or API changes. On the other hand, 29.0.0-rc2 is not an official stable released version. You may build a simple ads app in Android Studio to test which version is okay for ads showing.