FAQ
1. Steps to Upgrade Gradle Version for Unity Versions Before 2020.3.15
Go to Player Settings
-> Player
-> Android Tab
-> Publish Settings
-> Build
, and then check Custom Base Gradle Template, Custom Launcher Gradle Template, and Custom Main Gradle Template.
The following changes apply to the three files mainTemplate.gradle
, launcherTemplate.gradle
, and baseProjectTemplate.gradle
generated in the Assets/Plugins/Android/
folder.
Open baseProjectTemplate.gradle
and modify the file content:
dependencies {
...
// Change version 3.x.0 to 4.0.0
//classpath 'com.android.tools.build:gradle:3.x.0'
classpath 'com.android.tools.build:gradle:4.0.0'
}
Open both mainTemplate.gradle
and launcherTemplate.gradle
files, find the lintOptions
tag, and add the checkReleaseBuilds false configuration:
lintOptions {
abortOnError false
checkReleaseBuilds false
}
Additionally, to align the Gradle version with the Android Gradle Plugin version, you need to update the Gradle version. Download Gradle version 6.5.0, extract it to a custom folder, and uncheck Preferences
-> External Tools
-> Android
-> Gradle Installed with Unity (recommend)
in Unity. Instead, select the path to the extracted Gradle folder, such as <some path\>/gradle-6.5.0
.