play-games-plugin-for-unity icon indicating copy to clipboard operation
play-games-plugin-for-unity copied to clipboard

Build Failed Due To GooglePlayGamesPlugin

Open aeaktepe opened this issue 2 years ago • 8 comments

When I import play games plugin to my project, unity builds starts failing. "Gradle build failed. See the Console for details."

I checked and required files are existing Assets\GooglePlayGames\com.google.play.games\Editor\m2repository\com\google\games\gpgs-plugin-support\0.11.01

Min API: 24 Target API: 30

What I'm doing? 1- Importing latest release (GooglePlayGamesPlugin-0.11.01.unitypackage) into my project. 2- Resolving/Force resolving (tried both combined and separately) using android resolver 3- When I try to build, I get the error indicated above.

If I remove GooglePlayGames plugin then build succeeds.

Versions

  • Unity version: 2021.2.12f1
  • Google Play Games Plugin for Unity version: 0.11.01
  • Google Mobile Ads Plugin for Unity version: 7.0.0
  • Android Resolver version: 1.2.169

** Error Message (only related part) **

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

stderr[ Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

FAILURE: Build failed with an exception.

  • What went wrong: Could not determine the dependencies of task ':launcher:minifyReleaseWithProguard'.

Could not resolve all task dependencies for configuration ':launcher:releaseRuntimeClasspath'. 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://jcenter.bintray.com/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom - file:/C:/Users/ali/Documents/Unity Projects/Logistic King/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/gpgs-plugin-support-0.11.01.jar - file:/C:/Users/ali/Documents/Unity Projects/Logistic King/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/gpgs-plugin-support.jar - https://maven.google.com/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom - file:/C:/Users/ali/Documents/Unity Projects/Logistic King/Packages/com.google.play.games/Editor/m2repository/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom - file:/C:/Users/ali/.m2/repository/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 Required by: project :launcher > project :unityLibrary

aeaktepe avatar Mar 27 '22 03:03 aeaktepe

Well not exactly a solution but as a workaround, I copied all files from Assets/..../m2respository to one of the folders it was searching according to the error message.

Exactly to here: C:\Users<userName>.m2\repository\com\google\games\gpgs-plugin-support

aeaktepe avatar Mar 27 '22 22:03 aeaktepe

I have the same problem. It seems that android resolve step is not normal.

chle21 avatar Mar 29 '22 09:03 chle21

I fixed it by change Packages/com.google.play.games/Editor/m2repository to Assets/GooglePlayGames/com.google.play.games/Editor/m2repository in file GooglePlayGamesPluginDependencies.xml. Hope it helpful!

phamhung99 avatar Mar 30 '22 02:03 phamhung99

@phamhung99 This was the first thing I tried but for some reason it did not solve the problem on my end.

aeaktepe avatar Mar 30 '22 13:03 aeaktepe

I fixed it by change Packages/com.google.play.games/Editor/m2repository to Assets/GooglePlayGames/com.google.play.games/Editor/m2repository in file GooglePlayGamesPluginDependencies.xml. Hope it helpful!

I Solved it this way. Thx!

chle21 avatar Apr 12 '22 08:04 chle21

I fixed it by change Packages/com.google.play.games/Editor/m2repository to Assets/GooglePlayGames/com.google.play.games/Editor/m2repository in file GooglePlayGamesPluginDependencies.xml. Hope it helpful!

TY!!! This solve the issue. Also I wasnt see any error, the build got freeze and this solve it!

FedeJure avatar Aug 25 '22 15:08 FedeJure

Same I got from a previous version https://github.com/playgameservices/play-games-plugin-for-unity/issues/3128

I fixed it by change Packages/com.google.play.games/Editor/m2repository to Assets/GooglePlayGames/com.google.play.games/Editor/m2repository in file GooglePlayGamesPluginDependencies.xml. Hope it helpful!

RomainBitard avatar Apr 18 '23 14:04 RomainBitard

I had more or less the same error:

"Could not determine the dependencies of task ':launcher:lintVitalRelease'."

Solved it by: 1- Deleting the Assets/GeneratedLocalRepo folder (there were some folders missing) 2- Force resolving android (Assets/External dependency manager/Android Resolver/Force resolve)

Zarkend avatar Aug 25 '23 20:08 Zarkend