Skip to content

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:

  1. 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.

    Android API Level

  2. Export to Android Studio

    Modify the Android build settings by selecting File (or Unity Editor on MacOS) > Build Settings and check Export Project:

    Export Project

  3. 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 the Gradle JDK drop-down and set the Gradle JDK to use JDK 17 or later.

    Gradle JDK

    If you don't have JDK 17 installed, select the Download JDK options from the Gradle JDK menu bar and download a compatible version.

  4. Update the project-level build.gradle

    Set Gradle tools version to 8.1.1 or newer.

    plugins {
        id 'com.android.application' version '8.1.1' apply false
        id 'com.android.library' version '8.1.1' apply false
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    
  5. Update /gradle/gradle-wrapper.properties

    distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
    
  6. Run the Android Project

    From Android Studio, run gradle sync, and run the project.