Fixed: Unity Gradle Build failure

Google has API requirement and if you already got the new SDK API installed to do that, but after that you encounter Gradle building issue, try this:

Go to Player Settings >> Publishing Settings

Check the options as in the following figure

and then open Assets\Plugins\Android\gradleTemplate.properties and add the following line

android.suppressUnsupportedCompileSdk=34,35

worked for me using Unity 2022.3.28f1, and I was trying to update the app to API 34.

Another thing to notice is that the latest API is 35. However, I think I encountered some other issue when trying to use API 35. So, maybe it’s safer to just try to full fill the requirement by Google because lower API is more likely to be already tested by Unity.

*

If Gradle still fail, check if you have enabled ILCPP & ARM 64 in Player Settings, and if API is 34 instead of max installed (which could be 35)

If it’s fail again, consider updating your Unity Editor. The above solution work for me using Unity 2022.3.28f1, but not for Unity 2022.3.5f1


Discover more from Science Comics

Subscribe to get the latest posts sent to your email.

Leave a Reply

error: Content is protected !!