Tested : Unity 2020.3.11f1 and GoogleMobileAds-v6.1.2
Step 01 : Install GoogleMobileAds plugin and setup and Asset > External Dependency Manager > Android Resolver > resolve.
Step 02 : Set Target API Level 30 in Player Setting.
enter image description here
Step 03 : Tick in Custom Main Gradle Template and Custom Launcher Gradle Template.
enter image description here
Step 04: How mainTemplate and launcherTemplate files generating. [If not view then first build ignore the errors]
enter image description here
Step 05 : Added below code into mainTemplate.gradle file with your favorite editor.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
// Must be Android Gradle Plugin 3.6.0 or later. For a list of
// compatible Gradle versions refer to:
// https://developer.android.com/studio/releases/gradle-plugin
classpath 'com.android.tools.build:gradle:3.6.0'
}
}
allprojects {
repositories {
google()
mavenCentral()
flatDir {
dirs 'libs'
}
}
}
//Look like that
enter image description here
Step 06 : Download Gradle gradle-5.6.4-all.zip from grdale.org. Download from https://services.gradle.org/distributions/
After download extract the file and set gradle path into Edit > Preference > External Tools > Gradle Install with Unity(recommended) UnChecked
enter image description here
Step 07 : Build
Helpful Link : https://developers.google.com/ar/develop/unity-arf/android-11-build