Build Failures After Importing GPGS, Google IAP, and Google Ads into Unity 2022.3.50f1

I recently encountered consistent build failures when working with Unity Editor version 2022.3.50f1 on an empty project. The failures occurred after importing three major Google plugins:

  1. Google Play Games Services (GPGS), downloaded from GitHub (file: GooglePlayGamesPlugin-0.11.01.unitypackage).
  2. Google Mobile Ads, downloaded from GitHub (file: GoogleMobileAds-v9.2.1.unitypackage).
  3. Google IAP, downloaded from the official Google Unity packages page (file: com.google.play.assetdelivery-1.9.2.unitypackage).

These plugins are essential for Android game development, but importing all three resulted in repeated build errors.

Build Failure Context:

  • GPGS: The plugin version I used is 0.11.01 from GitHub, which has been updated to support Unity’s latest versions. However, it appears that this version may introduce dependencies or conflicts that cause compatibility issues with other Google plugins.
  • Google Ads: The Google Mobile Ads plugin (v9.2.1) from GitHub often introduces dependency issues, particularly with different versions of Android libraries.
  • Google IAP: The Google IAP plugin, downloaded from Google’s Unity packages page, adds additional complexity with Asset Delivery services, which may contribute to conflicts during build.

Potential Cause:

The build errors seem to stem from conflicting dependencies between these Google services. Each plugin manages its own dependencies (such as Google Play Services or AndroidX libraries), and when imported together, there may be version mismatches or duplicated library files.

I used Unity’s External Dependency Manager (EDM) to try resolving these conflicts, but even after attempting dependency resolution and checking AndroidManifest files for duplicates, the build failed consistently.

Proposed Solution:

Given the frequency of build failures when combining Google Play Games Services, Google Ads, and Google IAP, I propose that Google integrates these three core services into a unified plugin. A combined package would help beginners avoid common pitfalls like:

  • Dependency conflicts: A single package would manage all required libraries, preventing version mismatches.
  • Simplified setup: Developers wouldn’t need to manually resolve dependencies or troubleshoot conflicting AndroidManifest files.
  • Reduced build failures: A unified plugin would minimize the risk of plugin incompatibility, leading to more successful builds and fewer error-prone configurations.

By consolidating these plugins, Google could make the integration process much smoother for Unity developers, especially for those new to Android development. This would save significant time and effort spent on troubleshooting and debugging.

Has anyone else experienced similar build issues with these plugins? Any additional solutions or insights would be appreciated.

Would be much easier to help you if you would at lest share what errors do you get :slight_smile:
Wild guess - there’s an issue with GPGS 0.11.01 incorrectly declaring dependencies, you can read a bit more here: "We recommend using a newer Android Gradle plugin to use compileSdk = 34". How to solve? - #14 by IGuscin

P.S. External Dependecy Manager is Google’s :slight_smile:

Hello,
I have the exact same problem :

1- Open a new empty Unity project: 2022.3.50f1.

2- Install: In-App Purchasing 4.12.2.

3 -Import: GooglePlayGamesPlugin 0.11.01.

4- Import: GoogleMobileAds v9.2.1.

5- Fix Path in GooglePlayGamesPluginDependencies.xml:
(( url (unityProjectPath + “/Assets/GooglePlayGames/com.google.play.games/Editor/m2repository”) // Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11 ))

6- External Dependency Manager > Android Resolver > Resolve:
This automatically enables Custom Main Gradle Template, Custom Gradle Properties Template, and Custom Gradle Settings Template.

7- Android Dependencies resolution: succeeded.

8- Build.

  • Result: 4 errors :

1-


> Configure project :launcher
WARNING:The option setting 'android.aapt2FromMavenOverride=C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\34.0.0\aapt2.exe' is experimental.
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 34

This Android Gradle plugin (7.4.2) was tested up to compileSdk = 33

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=34
to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 34
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\34.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-33\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-34\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-35\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\34.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-33\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-34\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-35\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\34.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-33\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-34\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-35\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Errors during XML parse:
Additionally, the fallback loader failed to parse the XML.
Checking the license for package Android SDK Build-Tools 30.0.3 in C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\licenses
Warning: License for package Android SDK Build-Tools 30.0.3 not accepted.
Checking the license for package Android SDK Platform 31 in C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\licenses
Warning: License for package Android SDK Platform 31 not accepted.

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

2 -


FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseAidl'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     platforms;android-31 Android SDK Platform 31
     build-tools;30.0.3 Android SDK Build-Tools 30.0.3
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  All licenses can be accepted using the sdkmanager command line tool:
  sdkmanager --licenses
  Or, to transfer the license agreements from one workstation to another, see https://developer.android.com/studio/intro/update.html#download-with-gradle
  
  Using Android SDK: C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

3 -

CommandInvokationFailure: Gradle build failed. 
C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.5.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

Environment Variables:
SHIM_MCCOMPAT = 0x810000001
PROCESSOR_ARCHITECTURE = AMD64
AMPLITUDE_API_KEY_YELLOWBUCKET_DEV = 48835b4d1f5e342aefe5f016324d296a
CUDA_PATH_V11_2 = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2
ANDROID_NDK_ROOT = C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
DriverData = C:\Windows\System32\Drivers\DriverData
USERDOMAIN = AIPC
CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
COMPUTERNAME = AIPC
DEBUG_ENV_VAR = UnityHub
LOGONSERVER = \\AIPC
AMPLITUDE_TOKEN_GREENBUCKET_PROD = ZpUcbAdZXJYzNSoHsAWtL_s_JppwWid9
AMPLITUDE_DEPLOYMENT_KEY_RED_BUCKET_PROD = client-zH8Y7OK1i331EKuG77C6UxN8ygcM6LzS
PUBLIC = C:\Users\Public
ProgramData = C:\ProgramData
SESSIONNAME = Console
AMPLITUDE_TOKEN_YELLOWBUCKET_PROD = UYDQtPOw83dIfVy3SrW5oMyo7ru4PRkV
HDRLS_HOME_V5 = C:\Program Files\Lightmap\HDR Light Studio
NVIDIAWHITELISTED = 0x01
VRAY_MDL_PATH_3DSMAX2024 = C:\Program Files\Chaos Group\V-Ray\3ds Max 2024\mdl
APPDATA = C:\Users\spot-\AppData\Roaming
SystemRoot = C:\Windows
windir = C:\Windows
AMPLITUDE_API_KEY_REDBUCKET_DEV = 46b8b46515e7632fc42a504b72e05fd0
CUDA_PATH = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2
ProgramFiles(x86) = C:\Program Files (x86)
CUDA_CACHE_MAXSIZE = 268435456
ProgramW6432 = C:\Program Files
INTEL_DEV_REDIST = C:\Program Files (x86)\Common Files\Intel\Shared Libraries\
OS = Windows_NT
OneDriveConsumer = C:\Users\spot-\OneDrive
PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 158 Stepping 9, GenuineIntel
HOMEPATH = \Users\spot-
FPS_BROWSER_USER_PROFILE_STRING = Default
AMPLITUDE_TOKEN_REDBUCKET_DEV = U4PSN7S7PuYVRODivvdcFwbu8R6IHGqa
CHROME_CRASHPAD_PIPE_NAME = \\.\pipe\crashpad_24336_QWVNTBGVICOKBVLM
PROCESSOR_REVISION = 9e09
PROCESSOR_LEVEL = 6
MIC_LD_LIBRARY_PATH = C:\Program Files (x86)\Common Files\Intel\Shared Libraries\compiler\lib\mic
NVCUDASAMPLES_ROOT = C:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.2
CommonProgramFiles = C:\Program Files\Common Files
ZES_ENABLE_SYSMAN = 1
NVTOOLSEXT_PATH = C:\Program Files\NVIDIA Corporation\NvToolsExt\
JAVA_HOME = C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK
USERDOMAIN_ROAMINGPROFILE = AIPC
TEMP = C:\Users\spot-\AppData\Local\Temp
CommonProgramW6432 = C:\Program Files\Common Files
AMPLITUDE_TOKEN_YELLOWBUCKET_DEV = wKi8foVigDditGFvmZewRFWsEbX9Y0YO
AMPLITUDE_API_KEY_GREENBUCKET_DEV = 3ded2a762163603391a425f688f990c8
AMPLITUDE_API_KEY_REDBUCKET_PROD = ca12bb461ea96f9bdf5df4ded7d52994
VRAY_FOR_3DSMAX2024_PLUGINS = C:\ProgramData\Autodesk\ApplicationPlugins\VRay3dsMax2024/bin/plugins
HOMEDRIVE = C:
VRAY_GPU_PLATFORMS = c++/cpu #cuda_api;nvidia cuda nvidia geforce gtx 1050 ti gpu index0 #cuda_api;
USERNAME = spot-
OneDrive = C:\Users\spot-\OneDrive
AMPLITUDE_API_KEY_YELLOWBUCKET_PROD = e03a9bbe92dc38a88cdb068d24c65b46
PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
AMPLITUDE_TOKEN_REDBUCKET_PROD = jTIgKs5KTZOjiqEEVdZFbgo_VRhABduL
NUMBER_OF_PROCESSORS = 8
AMPLITUDE_TOKEN_GREENBUCKET_DEV = 84H2gMm_FJzhr3mBaX1lM1JVukmCM7d9
VRAY_SEND_FEEDBACK = 1
AMPLITUDE_DEPLOYMENT_KEY_RED_BUCKET_DEV = client-wbjHYrmeSR87GmWOE7LDpf7sUySOIKHm
PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
AMPLITUDE_API_KEY_GREENBUCKET_PROD = c86fea37a9e1d3f0878b96e15b111c7c
ComSpec = C:\Windows\system32\cmd.exe
ORIGINAL_XDG_CURRENT_DESKTOP = undefined
CUDA_PATH_V12_2 = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2
NVCUDASAMPLES11_2_ROOT = C:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.2
TMP = C:\Users\spot-\AppData\Local\Temp
SystemDrive = C:
AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa
FPS_BROWSER_APP_PROFILE_STRING = Internet Explorer
VRAY_FOR_3DSMAX2024_MAIN = C:\ProgramData\Autodesk\ApplicationPlugins\VRay3dsMax2024/bin
SENTRY_ACCESS_TOKEN = 3df78d9e53f8456aa90fbae044ce1a6261421ab1d0014674bc2e933477289017
AMPLITUDE_API_KEY_STAGING = 83ee04fccc67e4fcc7dd527c4c6f1e21
ALLUSERSPROFILE = C:\ProgramData
Path = C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\libnvvp;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\libnvvp;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\NVIDIA Corporation\Nsight Compute 2023.2.0\;C:\Program Files\dotnet\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\Git\cmd;C:\Users\spot-\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\spot-\AppData\Local\Programs\Python\Python310\;C:\Users\spot-\AppData\Local\Android\sdk\platform-tools;
ProgramFiles = C:\Program Files
ADSK_3DSMAX_x64_2024 = C:\Program Files\Autodesk\3ds Max 2024\
LOCALAPPDATA = C:\Users\spot-\AppData\Local
USERPROFILE = C:\Users\spot-
WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3


stderr[

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseAidl'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     platforms;android-31 Android SDK Platform 31
     build-tools;30.0.3 Android SDK Build-Tools 30.0.3
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  All licenses can be accepted using the sdkmanager command line tool:
  sdkmanager --licenses
  Or, to transfer the license agreements from one workstation to another, see https://developer.android.com/studio/intro/update.html#download-with-gradle
  
  Using Android SDK: C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s
]
stdout[

> Configure project :launcher
WARNING:The option setting 'android.aapt2FromMavenOverride=C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\34.0.0\aapt2.exe' is experimental.
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 34

This Android Gradle plugin (7.4.2) was tested up to compileSdk = 33

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=34
to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 34
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\34.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-33\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-34\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-35\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\34.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-33\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-34\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-35\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\34.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-33\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-34\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-35\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Errors during XML parse:
Additionally, the fallback loader failed to parse the XML.
Checking the license for package Android SDK Build-Tools 30.0.3 in C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\licenses
Warning: License for package Android SDK Build-Tools 30.0.3 not accepted.
Checking the license for package Android SDK Platform 31 in C:\Program Files\Unity\Hub\Editor\2022.3.50f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\licenses
Warning: License for package Android SDK Platform 31 not accepted.
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <0487843a8d11470d93843eaf98d77e73>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <0487843a8d11470d93843eaf98d77e73>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <0487843a8d11470d93843eaf98d77e73>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <0487843a8d11470d93843eaf98d77e73>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <0487843a8d11470d93843eaf98d77e73>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <0487843a8d11470d93843eaf98d77e73>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <0487843a8d11470d93843eaf98d77e73>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <0487843a8d11470d93843eaf98d77e73>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

4 -

Build completed with a result of 'Failed' in 15 seconds (14782 ms)
4 errors
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

As error states you haven’t accepted license for API 31. There’s couple ways of solving:

  1. Set Target API in player settings to 31. That would make Unity to download it for you.
  2. Use SDK manager to install SDK 31

Issue is with 9.2.1 of AdMob Unity SDK. Downgrading to 9.2.0 solved it for me. It seems to have a dependency on older build tools and min targets that don’t make sense.

Yeah guys thats the only solution currently, dont wasste time on v9.2.1

for people who googles the question and get here.

here’s my workflow after searching and testing to make build success right now in year 2025.

first you need to install a gradle 8.14 manually as google ads requires that. you also need to set build target as api 35 which google policy requires.
so you should download the gradle, set it manually in preferences of unity.

unity 2022 should be fine with api 35. however i used Android Studio to download a api 35 to the unity android sdk’s folder of build-tools.

then create an empty project. import the latest GPGS and google ads packages.
image
switch project platform to android and set your android players settings blablabla and don’t forget the api target should be 35


toggle all these 4 in player setting

in gradleTemplete.properties file,
add this to the file

android.suppressUnsupportedCompileSdk=35

this might help with some errors saying building with api 35

Then with the latest gpgs and google ads package together you still would have an error like this

Could not resolve all files for configuration ‘:launcher:debugRuntimeClasspath’.
No variants of com.google.games:gpgs-plugin-support:2.1.0 match the consumer attributes:

in a post of this.

this solution works for me.

WORKAROUND:
I've had the same problem. After EDM Resolve i had to change one path in settingsTemplate.gradle.
From this:
maven {
url (unityProjectPath + "/Assets/GooglePlayGames/Editor/m2repository")
}

To this:
maven {
url (unityProjectPath + "/Assets/GeneratedLocalRepo/GooglePlayGames/Editor/m2repository")
}

so you need to add a “GeneratedLocalRepo” inside the path of your maven url in settingsTemplate.gradle
Then build the apk successfully.

Hi.
I think I have found a solution to this problem.

  1. Unity 6000.0.54
  2. Install GooglePlayGamesPlugin-2.1.0.unitypackage - manual Google Play Games
  3. Edit Assets\GooglePlayGames\com.google.play.games\Editor\GooglePlayGamesPluginDependencies.xml file
<?xml version="1.0" encoding="UTF-8" ?>
<dependencies>
<!-- Internal library dependency generated at build time. 
    It also defines the transitive dependencies on play-services
-->
  <androidPackages>
    <androidPackage spec="com.google.games:gpgs-plugin-support:2.1.0@aar">
      <repositories>
        <repository>Assets/GeneratedLocalRepo/GooglePlayGames/com.google.play.games/Editor/m2repository</repository>
        <repository>Assets/GooglePlayGames/com.google.play.games/Editor/m2repository</repository>
      </repositories>
    </androidPackage>
  </androidPackages>
</dependencies>

Here the package format is changed to aar and the path to Assets/GeneratedLocalRepo/GooglePlayGames/com.google.play.games/Editor/m2repository is added.
4. Assets → External Dependency Manager → Android Resolver → Force Resolve
A folder called GeneratedLocalRepo will be created, inside of which there will be gpgs-plugin-support-2.1.0.aar
5. Clean build

This solution worked perfect on my end! Thank you so much!

Extra Edit: The above solution does indeed allow Unity to finally compile the build. But sign-in with Google Play Games still didn’t work on-device. I was able to fix that as well on my end by putting

dependencies {
    implementation "com.google.android.gms:play-services-games-v2:+"
}

in my mainTemplate.gradle file! Just putting this here in case anyone else has this issue. Boy this all has been a true nightmare.

+1 For this little bit.

Although one thing to consider is that mainTemplate.gradle is auto generated so a slight tweak to preserve sanity is to add the following to GooglePlayGamesPluginDependencies.xml underneath the androidPackage for com.google.games:gpgs-plugin-support:2.1.0

<androidPackage spec="com.google.android.gms:play-services-games-v2:+">
</androidPackage>

Thank you very much! I spent 30+ hours trying to solve this problem in the GPT chat. God bless you.

Thanks. It saved me.