Troubleshooting
Support for Unity IDE 2022.X
The Unity Editor is version locked to a particular iteration of Gradle. It has been established that earlier iterations of the Unity Editor utilise earlier versions of Gradle, which are incompatible with the latest version of Google Mobile Ads and other networks.
In order to facilitate the ongoing utilisation of Unity 2022, a potential solution is hereby presented.
Manually update Gradle
Prerequisites Before continuing, ensure you have the following:
- Download and install the latest stable version of Android Studio.
- Optional: For details on building for Android, see Java versions in Android builds
Steps:
-
Set Target API Level 34
From the main menu open
Edit > Project Settings > Player > Android > Other Settings
and set the Target API Level to API Level 34 or higher. -
Export to Android Studio
Modify the Android build settings by selecting
File (or Unity Editor on MacOS) > Build Settings
and check Export Project: -
Open Android Studio:
This section contains steps performed within Android Studio. Update Gradle JDK configuration Open the Gradle settings from
File (or Android Studio on MacOS) > Settings > Build > Execution > Deployment > Build Tools > Gradle
. Locate theGradle JDK
drop-down and set the Gradle JDK to use JDK 17 or later.If you don't have JDK 17 installed, select the Download JDK options from the Gradle JDK menu bar and download a compatible version.
-
Update the project-level build.gradle
Set Gradle tools version to 8.1.1 or newer.
-
Update
/gradle/gradle-wrapper.properties
-
Run the Android Project
From Android Studio, run gradle sync, and run the project.