You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just choose the desired version in Gradle Wrapper Project Settings and voilà!
The plugin will use the JDK and Gradle configured in Unity for generating the
wrapper, so there's no need to install or configure anything else.
The Gradle Version setting gets stored in the
ProjectSettings/GradleVersion.txt file.
Open the Gradle Wrapper section in Project Settings
Write the version of Gradle you want in the Gradle Version setting input
field
Mark Export Project in the Build Settings window
Hit the Export button
Enjoy 🍾
Why
If you open an exported project in Android Studio, it will
generate a Gradle Wrapper if none is found in the project.
It will use one of the newest versions of Gradle, which may be incompatible
with the project's build scripts, and may not be able to build.
Also, even though Unity bundles it's own version of Gradle and all others are
not officially supported, sometimes projects need Gradle features that are only
available in newer versions.
In this scenario, every developer would need to download this specific version
and configure Unity to use it.
On top of that, when dealing with multiple projects, chances are not all of
them need the same version of Gradle.
With gradlew, all you need to do is run it, either from Android Studio or
from the console - the wrapper will take care of downloading and running the
right version.
About
Automatically generate Gradle Wrapper (gradlew) when exporting Android projects in Unity