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
<?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.
Force Resolve Libraries using Android Dependency Manager
Restart Unity once (optional)
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
Open gradleTemplate.properties and make sure you see these lines:
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.
Open settingsTemplate.gradle, paste the above lines together inside dependencyResolutionManagement → repositories
This almost worked - but I had to copy other maven commands from mainTemplate.gradle to get it to build (I had an IronSource repository that wasn't found after the google issue was solved).
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
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
FAILURE: Build failed with an exception.
* What went wrong: [error]
Execution failed for task ':launcher:mergeDexRelease'.
> Could not resolve all files for configuration ':launcher:releaseRuntimeClasspath'.
> Could not resolve all files for configuration ':launcher:releaseRuntimeClasspath'.
> No variants of com.google.games:gpgs-plugin-support:2.1.0 match the consumer attributes:
- com.google.games:gpgs-plugin-support:2.1.0 configuration runtime declares a library for use during runtime:
- Incompatible because this component declares a component, as well as attribute 'artifactType' with value 'srcaar' and the consumer needed a component, as well as attribute 'artifactType' with value 'android-classes-jar'
- Other compatible attributes:
- Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.7.2')
- Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
- Doesn't say anything about its target Java environment (preferred optimized for Android)
- Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
I think I have found a solution to this problem.
Unity 6000.0.54
Install GooglePlayGamesPlugin-2.1.0.unitypackage - manual Google Play Games
<?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>
</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
The solution is similar to the solution above from @ttran07
I had the same error a while ago. The problem was that I first installed the package through Git and then locally, because I thought the .unitypackage file no longer existed (but it actually is inside the current-build folder). When I imported it using the .unitypackage, those errors went away.
What went wrong:
Execution failed for task ‘:unityLibrary:compileReleaseJavaWithJavac’.
Could not resolve all files for configuration ‘:unityLibrary:releaseCompileClasspath’.
Could not resolve all dependencies for configuration ‘:unityLibrary:releaseCompileClasspath’.
Could not find com.google.games:gpgs-plugin-support:2.1.0.
Required by:
project :unityLibrary
helpppp
Same problem unfortunately
– milos273