Build failing with Google Play Services Plugin. Could not find com.google.games:gpgs-plugin-support:0.11.01
Asked Answered
M

3

2

I am trying to build my app for android. I currently have the Google AdMob package installed as well as the Google Play Services plugin however it is failing to build with the google play services package.

> Could not find com.google.games:gpgs-plugin-support:0.11.01.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
       - https://repo.maven.apache.org/maven2/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
       - file:UNITY_PROJECT/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/gpgs-plugin-support-0.11.01.jar
       - file:UNITY_PROJECT/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/gpgs-plugin-support.jar

I already have the location set correctly in

Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml

<?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:0.11.01">
      <repositories>
        <repository>Assets/GooglePlayGames/com.google.play.games/Editor/m2repository</repository>
      </repositories>
    </androidPackage>
  </androidPackages>
</dependencies>

I have done multiple force resolves, I have changed the JAVA_HOME environment variable. I am at a complete loss as to what is causing this issue and I suspect it’s something to do with the admob package and Google Play Services conflicting.

Margueritamarguerite answered 11/12, 2023 at 2:24 Comment(1)

Same problem unfortunately

Straddle
T
0

I was having exactly the same problem with GooglePlayGames & GoogleSignIn. Here’s how I solved it:

Unity version: 2022.3
Scripting backend: IL2CPP
Build type: App Bundle

First, make sure you’ve done the other things in correct order:

  1. Enable Custom Main Gradle Template, Custom Gradle Properties Template & Custom Gradle Settings Template

  2. Force Resolve Libraries using Android Dependency Manager

  3. Restart Unity once (optional)

  4. Check <repository> path in Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml
    Make sure its Assets/GooglePlayGames/com.google.play.games/Editor/m2repository and not Library/GooglePlayGames/com.google.play.games/Editor/m2repository

  5. Open gradleTemplate.properties and make sure you see these lines:

android.useAndroidX=true
android.enableJetifier=true

If not, then add them manually.

The actual solution steps:

  1. Open mainTemplate.gradle and find two separate lines:
    def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
    and
    url (unityProjectPath + "/Assets/GeneratedLocalRepo/GoogleSignIn/Editor/m2repository") inside a maven block. In your case it should be GooglePlayGames.

  2. Open settingsTemplate.gradle, paste the above lines together inside dependencyResolutionManagement → repositories

It should look like:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
    repositories {
        def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
        maven {
            url (unityProjectPath + "/Assets/GeneratedLocalRepo/GoogleSignIn/Editor/m2repository") // Assets/GoogleSignIn/Editor/GoogleSignInSupportDependencies.xml:9
        }
        **ARTIFACTORYREPOSITORY**
        google()
        mavenCentral()
        flatDir {
            dirs "${project(':unityLibrary').projectDir}/libs"
        }
    }
}

In your case again, it should be GooglePlayGames, not GoogleSignIn.

That should be it! Probably not the best solution, just a way to successfully get past gradle build for now.

Toxic answered 30/1, 2024 at 21:23 Comment(2)

Thank you so much! The settingsTemplate.gradle was the issue, added that file with the repository and it works!

Margueritamarguerite

This worked for me too :+1:

Dovecote
G
0

Hi !
I have exactly the same problem, despite the procedures followed to the letter I still get the error message. I created a new project in doubt, there is no other package that could harm the build.

If I comment out the implement line in the mainTemplate I can build without problem.

This is the error message :
FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • What went wrong:
    Execution failed for task ‘:launcher:checkReleaseDuplicateClasses’.

Could not resolve all dependencies for configuration ‘:launcher:releaseRuntimeClasspath’.
The project declares repositories, effectively ignoring the repositories you have declared in the settings.
You can figure out how project repositories are declared by configuring your build to fail on project repositories.
See Declaring repositories for details.
Could not find com.google.games:gpgs-plugin-support:0.11.01.
Searched in the following locations:
- file:/H:/Test_Google_Login/Assets/GeneratedLocalRepo/GooglePlayGames/Editor/m2repository/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
- .google.com/dl/android/maven2/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
- https://repo.maven.apache.org/maven2/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
- file:/H:/Test_Google_Login/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/gpgs-plugin-support-0.11.01.jar
- file:/H:/Test_Google_Login/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/gpgs-plugin-support.jar
Required by:
project :launcher > project :unityLibrary

Do you have some other idea ? Thank a lot

Using Unity 2022.3.6f1

Glassware answered 22/1, 2024 at 16:58 Comment(1)

It seems that I found the solution, I just had to keep these lines in the settingTemplate: pluginManagement { repositories { ARTIFACTORYREPOSITORY gradlePluginPortal() google() mavenCentral() } } include ':launcher', ':unityLibrary' INCLUDES

Glassware
N
0

Too complicated. Here try this
Source: https://www.youtube.com/watch?v=a8ynwRd8Uxc

  1. Open file: Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml

  2. Find the following line

<repository>Packages/com.google.play.games/Editor/m2repository</repository>

  1. Replace it with:

<repository>Assets/GooglePlayGames/com.google.play.games/Editor/m2repository</repository>

  1. Save and close file
  2. On Unity, click menu AssetsExternal Dependency ManagerAndroid ResolverForce Resolve
  3. Lift your hands up into the air and praise God Almighty, you’re done.
Nijinsky answered 19/3, 2024 at 9:25 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.