googlesamples / unity-jar-resolver

Unity plugin which resolves Android & iOS dependencies and performs version management
Other
1.29k stars 348 forks source link

[Bug] EDM4U 1.2.183: Error occurs in GooglePlayGamesPlugin #716

Open crSudo opened 3 weeks ago

crSudo commented 3 weeks ago

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the issue here:

(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)

※I am Japanese. I am using a translation site for questions. Please let me know if there is any misunderstanding.

①. Create two new projects in Unity: A-project and B-project. ②. A-project: Import GooglePlayGamesPlugin-0.11.01.unitypackage. ③. B-project: Import GoogleMobileAds-v9.3.0.unitypackage. ④. A-project: Delete ExternalDependencyManager. ⑤. A-project: Copy ExternalDependencyManager from B-project to A-project. ⑥. A-project: Run [Assets]-[External Dependency Manager]-[Android Resolver]-[Resolve]. ⑦. A-project: Run [Build Setting]-[Build]. The following error occurs.

Execution failed for task ':launcher:mergeLibDexDebug'.
> Could not resolve all files for configuration ':launcher:debugRuntimeClasspath'.
   > Failed to transform classes.jar (project :unityLibrary) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.AgpVersionAttr=7.1.2, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.gradle.internal.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=22, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Could not resolve all files for configuration ':launcher:debugRuntimeClasspath'.
         > No variants of com.google.games:gpgs-plugin-support:0.11.01 match the consumer attributes:
             - com.google.games:gpgs-plugin-support:0.11.01 configuration runtime:
                 - Incompatible because this component declares attribute 'artifactType' with value 'srcaar' and the consumer needed attribute 'artifactType' with value 'android-classes-jar'
                 - Other compatible attributes:
                     - Doesn't say anything about asm-transformed-variant (required 'NONE')
                     - Doesn't say anything about dexing-enable-desugaring (required 'true')
                     - Doesn't say anything about dexing-is-debuggable (required 'true')
                     - Doesn't say anything about dexing-min-sdk (required '22')

If you look at \Assets\Plugins\Android\settingsTemplate.gradle, you will see the following: url (unityProjectPath + "/Assets/GooglePlayGames/com.google.play.games/Editor/m2repository") // Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11 In EDM4U 1.2.179, GeneratedLocalRepo is written in the path. url "file:///D:/ApplicationUnity_SDK/GooglePlayGamesPlugin/Assets/GeneratedLocalRepo/GooglePlayGames/com.google.play.games/Editor/m2repository" // Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11 I think the error occurs because GeneratedLocalRepo is not specified. Is that correct?

◇Package download site https://github.com/googleads/googleads-mobile-unity/releases/tag/v9.3.0 https://github.com/playgameservices/play-games-plugin-for-unity

Please answer the following, if applicable:

What's the issue repro rate? (eg 100%, 1/5 etc)

100%

google-oss-bot commented 3 weeks ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.

crSudo commented 3 weeks ago

I fixed it with the following but I get the same error:

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

Packages/com.google.play.games/Editor/m2repository

Assets/GooglePlayGames/com.google.play.games/Editor/m2repository
crSudo commented 3 weeks ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.

The title was left blank so we added it. Is there anything else that doesn't follow the template?

StefanMilkov commented 3 weeks ago

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") }

JamesKim2998 commented 3 weeks ago

+1

argzdev commented 2 weeks ago

Hey @crSudo. Thanks for reaching out.

I believe this step:

⑤. A-project: Copy ExternalDependencyManager from B-project to A-project.

Will cause an issue, since "copying" would likely result to dependencies not being imported correctly. Have you tried importing the ED4MU via Assets > Import Package > Custom Package... from here? This will overwrite any possible file conflicts.

Thanks for suggesting workarounds, instead of manually changing the maven path. You may enable this under the Assets > External Dependency Manager > Android Resolver > Settings, there is an option "Use Full Custom Local Maven Repo Path", "When building Android app through Unity". Checking that on will make it just use the current path of the Unity project, instead of relying on DIR_UNITYPROJECT. There are potentially some issues with that, depending on your build infrastructure, but that is the most straightforward workaround.

354756998-1529eb2e-ab14-4fbe-8beb-d75a80703538

That said, on my testing so far I'm unable to reproduce the behavior. Here's what I did:

  1. Create new Project
  2. Add GooglePlayGamesPlugin-0.11.01.unitypackage via Assets > Import Package > Custom Package...
  3. Delete External Dependency Manager folder under the Assets folder.
  4. Add external-dependency-manager-1.2.183.unitypackage via Assets > Import Package > Custom Package... from our download links.
  5. Go to Assets > External Dependency Manager > Android Resolver > Settings, turn on When building Android app through Unity under Use Full Custom Local Maven Repo Path
  6. Try Assets > External Dependency Manager > Android Resolver > Resolve, no errors shown.
  7. Run app, no errors shown.

Let me know if these work.

crSudo commented 2 weeks ago

Thank you for your reply.

I tried to build it using the method you instructed, but an error occurred.

  1. Create new Project
  2. Add GooglePlayGamesPlugin-0.11.01.unitypackage via Assets > Import Package > Custom Package...
  3. Delete External Dependency Manager folder under the Assets folder.
  4. Add external-dependency-manager-1.2.183.unitypackage via Assets > Import Package > Custom Package...
  5. [Assets > External Dependency Manager] is not displayed, so restart the computer.
  6. The following dialog will appear. Select Apply.
    
    Google Version Handler
    Would you like to delete the following obsolete files in your project?
    Assets\Play ServicesResolver\Editor\play-services-resolver_v1.2.137.0.txt (GooglePlayGamesPlugin)
7. Go to Assets > External Dependency Manager > Android Resolver > Settings, turn on "When building Android app through Unity" under Use Full Custom Local Maven Repo Path

*A warning message was displayed. Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11: Repo path 'Packages/com.google.play.games/Editor/m2repository' does not exist.

8. Run Assets > External Dependency Manager > Android Resolver > Resolve
*Assets/GeneratedLocalRepo was not created.

7. Run [File]-[Build Setting]-[Build]

*The following error occurred:

Could not resolve all files for configuration ':launcher:releaseRuntimeClasspath'. See the Console for details.

―――――――――――――――――――――――――――――――― Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

2: Task failed with an exception.

BUILD FAILED in 9s

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


I fixed the following warning, but an error still occurred.
`Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11: Repo path 'Packages/com.google.play.games/Editor/m2repository' does not exist.`

1. Warning correction
\Assets\GooglePlayGames\com.google.play.games\Editor\GooglePlayGamesPluginDependencies.xml
Packages/com.google.play.games/Editor/m2repository
↓
Assets/GooglePlayGames/com.google.play.games/Editor/m2repository

2. Run Assets > External Dependency Manager > Android Resolver > Resolve.
*Assets/GeneratedLocalRepo was not created.

3. Run Assets > External Dependency Manager > Android Resolver > Force Resolve.
*Assets/GeneratedLocalRepo has been created.

4. Run [File]-[Build Setting]-[Build]

The following error occurred:

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 注意:D:\ApplicationUnity_SDK\Google_GooglePlayGamesPlugin\GooglePlayGamesPlugin_0_11_01\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.javaは推奨されないAPIを使用またはオーバーライドしています。 注意:詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。

FAILURE: Build failed with an exception.

BUILD FAILED in 7s

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


When I looked at \Assets\Plugins\Android\settingsTemplate.gradle
, it was url "file:///D:/ApplicationUnity_SDK/Google/_GooglePlayGamesPlugin/GooglePlayGamesPlugin_0_11_01/Assets/GooglePlayGames/com.google.play.games/Editor/m2repository"
and it didn't reference GeneratedLocalRepo.

Best Regards
crSudo
argzdev commented 2 weeks ago

Thanks for the extra details, @crSudo.

The stacktrace seems to point to a lower version of AGP. com.android.build.api.attributes.AgpVersionAttr=7.1.2

I have a hunch that this could be due to using a lower version of Unity Editor likely resulting to a faulty AGP and Gradle. Could you try using the latest version of Unity Editor 2022.3.51f1 from the official Unity website. This would result to the following Gradle and AGP versions:

Gradle Android Gradle plug-in version
7.5.1 7.4.2

For context, we've resolved issues before where a higher version of Unity Editor is needed since it uses a more stable version matrix of Gradle and AGP.

Let me know if it works. Thanks!

crSudo commented 2 weeks ago

@argzdev Thank you for your reply.

■Unity Update Verification When I imported dependency-manager-1.2.183.unitypackage in Unity 2022.3.51f1, the following error occurred.

I also fixed \Assets\GooglePlayGames\com.google.play.games\Editor\GooglePlayGamesPluginDependencies.xml.

> Configure project :launcher
WARNING:The option setting 'android.aapt2FromMavenOverride=D:\Tool\Unity\2022.3.51f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\34.0.0\aapt2.exe' is experimental.

> Configure project :unityLibrary:GooglePlayGamesManifest.androidlib
WARNING:minSdkVersion (22) is greater than targetSdkVersion (16) for variant "debug". Please change the values such that minSdkVersion is less than or equal to targetSdkVersion.
WARNING:minSdkVersion (22) is greater than targetSdkVersion (16) for variant "release". Please change the values such that minSdkVersion is less than or equal to targetSdkVersion.
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 35

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

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=35
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 = 35

> Task :unityLibrary:preBuild UP-TO-DATE
99 actionable tasks: 50 executed, 49 up-to-date

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
����:D:\ApplicationUnity_SDK\Google\_GooglePlayGamesPlugin\GPG_0_11_01_U2022_3_51\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java�͐�������Ȃ�API��g�p�܂��̓I�[�o�[���C�h���Ă��܂��B
����:�ڍׂ́A-Xlint:deprecation�I�v�V������w�肵�čăR���p�C�����Ă��������B

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:mergeDexRelease'.
> Could not resolve all files for configuration ':launcher:releaseRuntimeClasspath'.
   > Failed to transform classes.jar (project :unityLibrary) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.AgpVersionAttr=7.4.2, com.android.build.api.attributes.BuildTypeAttr=release, com.android.build.gradle.internal.attributes.VariantAttr=release, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=false, dexing-min-sdk=22, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Could not resolve all files for configuration ':launcher:releaseRuntimeClasspath'.
         > No variants of com.google.games:gpgs-plugin-support:0.11.01 match the consumer attributes:
             - com.google.games:gpgs-plugin-support:0.11.01 configuration runtime declares a runtime of a component:
                 - 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 asm-transformed-variant (required 'NONE')
                     - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '7.4.2')
                     - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                     - Doesn't say anything about dexing-enable-desugaring (required 'true')
                     - Doesn't say anything about dexing-enable-jacoco-instrumentation (required 'false')
                     - Doesn't say anything about dexing-is-debuggable (required 'false')
                     - Doesn't say anything about dexing-min-sdk (required '22')
                     - Doesn't say anything about its target Java environment (preferred optimized for Android)

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 26s

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
CommandInvokationFailure: Gradle build failed. 
D:\Tool\Unity\2022.3.51f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "D:\Tool\Unity\2022.3.51f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.5.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

Environment Variables:
~

stderr[
����:D:\ApplicationUnity_SDK\Google\_GooglePlayGamesPlugin\GPG_0_11_01_U2022_3_51\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java�͐�������Ȃ�API��g�p�܂��̓I�[�o�[���C�h���Ă��܂��B
����:�ڍׂ́A-Xlint:deprecation�I�v�V������w�肵�čăR���p�C�����Ă��������B

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:mergeDexRelease'.
> Could not resolve all files for configuration ':launcher:releaseRuntimeClasspath'.
   > Failed to transform classes.jar (project :unityLibrary) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.AgpVersionAttr=7.4.2, com.android.build.api.attributes.BuildTypeAttr=release, com.android.build.gradle.internal.attributes.VariantAttr=release, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=false, dexing-min-sdk=22, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Could not resolve all files for configuration ':launcher:releaseRuntimeClasspath'.
         > No variants of com.google.games:gpgs-plugin-support:0.11.01 match the consumer attributes:
             - com.google.games:gpgs-plugin-support:0.11.01 configuration runtime declares a runtime of a component:
                 - 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 asm-transformed-variant (required 'NONE')
                     - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '7.4.2')
                     - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                     - Doesn't say anything about dexing-enable-desugaring (required 'true')
                     - Doesn't say anything about dexing-enable-jacoco-instrumentation (required 'false')
                     - Doesn't say anything about dexing-is-debuggable (required 'false')
                     - Doesn't say anything about dexing-min-sdk (required '22')
                     - Doesn't say anything about its target Java environment (preferred optimized for Android)

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 26s
]
stdout[

> Configure project :launcher
WARNING:The option setting 'android.aapt2FromMavenOverride=D:\Tool\Unity\2022.3.51f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\34.0.0\aapt2.exe' is experimental.

> Configure project :unityLibrary:GooglePlayGamesManifest.androidlib
WARNING:minSdkVersion (22) is greater than targetSdkVersion (16) for variant "debug". Please change the values such that minSdkVersion is less than or equal to targetSdkVersion.
WARNING:minSdkVersion (22) is greater than targetSdkVersion (16) for variant "release". Please change the values such that minSdkVersion is less than or equal to targetSdkVersion.
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 35

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

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=35
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 = 35

> Task :unityLibrary:preBuild UP-TO-DATE

■About GooglePlayGamesPluginDependencies.xml The following warning occurs. Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11: Repo path 'Packages/com.google.play.games/Editor/m2repository' does not exist. UnityEngine.Debug:LogWarning (object)

*Assets/GeneratedLocalRepo is not created.

GooglePlayGamesPluginDependencies.xml is set as Packages/com.google.play.games/Editor/m2repository. However, there is no [com.google.play.games/Editor/m2repository] folder in the Packages folder. Is this specified correctly? Or are the following settings correct?

Assets/GooglePlayGames/com.google.play.games/Editor/m2repository

Best Regards crSudo

crSudo commented 2 weeks ago

@argzdev Firebase uses ExternalDependencyManager 1.2.183, but no errors occurred. I tried changing the folder structure to match Firebase, and the errors disappeared.

Go to the Google Play Games folder.

\Assets\GooglePlayGames\com.google.play.games\Editor\m2repository
↓
\Assets\GooglePlayGames\m2repository

◇Firebase download site Firebase can be downloaded from the following site: https://firebase.google.com/docs/unity/setup?hl=ja FirebaseAnalytics.unitypackage

■Regarding external-dependency-manager-1.2.182 I tried using external-dependency-manager 1.2.182 and no errors occurred. Were there any changes in specifications when changing from 1.2.182 to 1.2.183? *Performed with Unity 2022.3.22f1.

  1. Create new Project
  2. Add GooglePlayGamesPlugin-0.11.01.unitypackage via Assets > Import Package > Custom Package...
  3. Delete External Dependency Manager folder under the Assets folder.
  4. Add external-dependency-manager-1.2.182.unitypackage via Assets > Import Package > Custom Package...
  5. [Assets > External Dependency Manager] is not displayed, so restart the computer.
  6. [Google Version Handler] dialog will appear. Select Apply.
  7. Modify GooglePlayGamesPluginDependencies.xml

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

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

I checked \Assets\Plugins\Android\settingsTemplate.gradle and it specified the GeneratedLocalRepo folder.

  1. Run Assets > External Dependency Manager > Android Resolver > Resolve
  2. Run Assets > External Dependency Manager > Android Resolver > Force Resolve
  3. Run [File]-[Build Setting]-[Build]

Best Regards crSudo

argzdev commented 2 weeks ago

Thanks for the additional information, @crSudo. Yes, there were changes made in version 1.2.183, this is to accommodate the usage of Unity 6. Here's the pull request that made the change.

However, I'm not sure if I understand correctly. So if you use this setup with version 1.2.183 it doesn't work, and it only works with version 1.2.182? Is that correct?

In my testing, there was no need to do:

  1. Modify GooglePlayGamesPluginDependencies.xml Assets\GooglePlayGames\com.google.play.games\Editor\GooglePlayGamesPluginDependencies.xml

It automatically detects the right path for the repository and works.

crSudo commented 2 weeks ago

@argzdev

■About GooglePlayGamesPluginDependencies.xml It seems like [\Assets\GooglePlayGames\com.google.play.games\package.json] isn't working.

Have you set the GitHub URL or anything in Unity Package Manager? I checked the GooglePlayGames site, but I couldn't find any particular setting method. https://github.com/playgameservices/play-games-plugin-for-unity

■About Unity 6000.0.25f1 I tried checking with Unity 6000.0.25f1, but I still got an error.

Best Regards crSudo

argzdev commented 2 weeks ago

Have you set the GitHub URL or anything in Unity Package Manager?

I have not tried adding GooglePlayGames via UPM. I only followed through the guide on the official website. The official guide uses the .unitypackage file in the current-build directory.

I was able to reproduce your issue now. You're using Minimum API level at 22 which I believe isn't working properly with the new Unity Editor version. Could you set it to 24, it should work correctly now.

Let me know if it works. Thanks!

crSudo commented 2 weeks ago

@argzdev When testing with Unity 6000.0.25f1, the minimum API level was set to [23]. I tried changing the minimum API level to [24], but an error occurred. When I checked the console, the following warning was output:

 This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.
System.Reflection.MethodBase:Invoke (object,object[])
GooglePlayServices.UnityCompat:FindNewestInstalledAndroidSDKVersion () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/UnityCompat.cs:348)
GooglePlayServices.UnityCompat:GetAndroidTargetSDKVersion () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/UnityCompat.cs:136)
GooglePlayServices.PlayServicesResolver:CheckApiLevelForJetifier (bool,string,System.Action`1<GooglePlayServices.PlayServicesResolver/ApiLevelJetifierResult>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2742)
GooglePlayServices.PlayServicesResolver/<>c__DisplayClass144_0:<CanEnableJetifierOrPromptUser>b__0 (bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2810)
GooglePlayServices.PlayServicesResolver:CheckGradleVersionForJetifier (bool,string,System.Action`1<bool>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2717)
GooglePlayServices.PlayServicesResolver:CanEnableJetifierOrPromptUser (string,System.Action`1<bool>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2808)
GooglePlayServices.PlayServicesResolver:ResolveUnsafeAfterJetifierCheck (System.Action`1<bool>,bool,bool,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1850)
GooglePlayServices.PlayServicesResolver:ResolveUnsafeAfterMainTemplateCheck (System.Action`1<bool>,bool,bool,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1796)
GooglePlayServices.PlayServicesResolver/<>c__DisplayClass110_0:<ScheduleResolve>b__1 () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1751)
GooglePlayServices.PlayServicesResolver:ExecuteNextResolveJob () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1598)
GooglePlayServices.PlayServicesResolver:ScheduleResolve (bool,bool,System.Action`1<bool>,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1764)
GooglePlayServices.PlayServicesResolver:ExecuteMenuResolve (bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2143)
GooglePlayServices.PlayServicesResolver:MenuForceResolve () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2167)
Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11: Repo path 'Packages/com.google.play.games/Editor/m2repository' does not exist.
UnityEngine.Debug:LogWarning (object)
Google.Logger:Log (string,Google.LogLevel) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/VersionHandlerImpl/src/Logger.cs:129)
GooglePlayServices.PlayServicesResolver:Log (string,Google.LogLevel) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1077)
GooglePlayServices.GradleResolver:RepoPathToUri (string,string) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/GradleResolver.cs:236)
GooglePlayServices.GradleResolver:DependenciesToRepoUris (System.Collections.Generic.IEnumerable`1<Google.JarResolver.Dependency>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/GradleResolver.cs:279)
GooglePlayServices.PlayServicesResolver:GetRepos (System.Collections.Generic.IEnumerable`1<Google.JarResolver.Dependency>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2209)
GooglePlayServices.LocalMavenRepository:FindLocalRepos (System.Collections.Generic.ICollection`1<Google.JarResolver.Dependency>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/LocalMavenRepository.cs:41)
GooglePlayServices.LocalMavenRepository:FindAarsInLocalRepos (System.Collections.Generic.ICollection`1<Google.JarResolver.Dependency>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/LocalMavenRepository.cs:76)
GooglePlayServices.LocalMavenRepository:PatchPomFilesInLocalRepos (System.Collections.Generic.ICollection`1<Google.JarResolver.Dependency>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/LocalMavenRepository.cs:191)
GooglePlayServices.PlayServicesResolver:DeleteResolvedLibrariesFromGradleTemplate (bool,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1680)
GooglePlayServices.PlayServicesResolver:ResolveUnsafe (System.Action`1<bool>,bool,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2023)
GooglePlayServices.PlayServicesResolver:ResolveUnsafeAfterPromptCheck (System.Action`1<bool>,bool,bool,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1944)
GooglePlayServices.PlayServicesResolver/<>c__DisplayClass113_0:<ResolveUnsafeAfterJetifierCheck>b__0 (bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1853)
GooglePlayServices.PlayServicesResolver/<>c__DisplayClass144_0:<CanEnableJetifierOrPromptUser>b__1 (GooglePlayServices.PlayServicesResolver/ApiLevelJetifierResult) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2825)
GooglePlayServices.PlayServicesResolver:CheckApiLevelForJetifier (bool,string,System.Action`1<GooglePlayServices.PlayServicesResolver/ApiLevelJetifierResult>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2789)
GooglePlayServices.PlayServicesResolver/<>c__DisplayClass144_0:<CanEnableJetifierOrPromptUser>b__0 (bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2810)
GooglePlayServices.PlayServicesResolver:CheckGradleVersionForJetifier (bool,string,System.Action`1<bool>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2717)
GooglePlayServices.PlayServicesResolver:CanEnableJetifierOrPromptUser (string,System.Action`1<bool>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2808)
GooglePlayServices.PlayServicesResolver:ResolveUnsafeAfterJetifierCheck (System.Action`1<bool>,bool,bool,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1850)
GooglePlayServices.PlayServicesResolver:ResolveUnsafeAfterMainTemplateCheck (System.Action`1<bool>,bool,bool,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1796)
GooglePlayServices.PlayServicesResolver/<>c__DisplayClass110_0:<ScheduleResolve>b__1 () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1751)
GooglePlayServices.PlayServicesResolver:ExecuteNextResolveJob () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1598)
GooglePlayServices.PlayServicesResolver:ScheduleResolve (bool,bool,System.Action`1<bool>,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1764)
GooglePlayServices.PlayServicesResolver:ExecuteMenuResolve (bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2143)
GooglePlayServices.PlayServicesResolver:MenuForceResolve () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2167)

Also, when you run [Build], the error is as follows:

* What went wrong:
Execution failed for task ':launcher:checkReleaseAarMetadata'.
> Could not resolve all files 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://repo.maven.apache.org/maven2/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
       - file:/D:/ApplicationUnity_SDK/Google/_GooglePlayGamesPlugin/GPG_0_11_01_U6000_0_25f1_2D/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/nor25/.m2/repository/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
       - file:/D:/ApplicationUnity_SDK/Google/_GooglePlayGamesPlugin/GPG_0_11_01_U6000_0_25f1_2D/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/gpgs-plugin-support-0.11.01.jar
       - file:/D:/ApplicationUnity_SDK/Google/_GooglePlayGamesPlugin/GPG_0_11_01_U6000_0_25f1_2D/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/gpgs-plugin-support.jar
     Required by:
         project :launcher > project :unityLibrary

■ Regarding Internet searches This issue seems to be a problem on the following sites as well. ◇Modify settingsTemplate.gradle https://github.com/playgameservices/play-games-plugin-for-unity/issues/3313

◇GooglePlayGamesPluginDependencies.xml modified https://github.com/playgameservices/play-games-plugin-for-unity/issues/3145 https://stackoverflow.com/questions/77619485/build-failing-with-google-play-services-plugin-could-not-find-com-google-games https://discussions.unity.com/t/build-failing-with-google-play-services-plugin-could-not-find-com-google-games0-11-01/319041/2

Best Regards crSudo

argzdev commented 2 weeks ago

This is a different issue, @crSudo. I tested with Unity 6000.0.23f1 and wasn't able to encounter this issue.

From your stacktrace:

 This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.

It seems to be a configuration issue on your side. Which you likely need to update your CLI tools. That said, I believe we have resolved the initial problem of your issue. Could you try your setup with Unity Editor version 2022.3.52f1 and with Minimum API level set at 24?

crSudo commented 2 weeks ago

I used Unity 2022.3.52f1 and set the Minimum API Level to 24, but an error was output.

  1. Create new Project: Launch on [Windows,Mac,Linux].
  2. Add GooglePlayGamesPlugin-0.11.01.unitypackage via Assets > Import Package > Custom Package...
  3. Delete External Dependency Manager folder under the Assets folder.
  4. Add external-dependency-manager-1.2.183.unitypackage via Assets > Import Package > Custom Package...
  5. Unity MenuBar [File]-[Build Settings] Select Android.
  6. Select [Switch Platform].
  7. [Enable Android Auto-resolution]: Select Enable.
  8. The [Google Version Handler] dialog will appear. Select Apply.
  9. Select [File]-[Build Settings]-[Player Settings] and change the Minimum API Level to [Android 7.0 API Level 24].
  10. Run Assets > External Dependency Manager > Android Resolver > Resolve.
  11. Run Assets > External Dependency Manager > Android Resolver > Force Resolve. The following warning will be displayed.
Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11: Repo path 'Packages/com.google.play.games/Editor/m2repository' does not exist.
UnityEngine.Debug:LogWarning (object)

Also, Assets/GeneratedLocalRepo is not created.

  1. Run [File]-[Build Setting]-[Build] The following dialog was displayed:
Bulld failure
Could not resolve all files for configuration ':unityLibrary:releaseCompileClasspath'. See the Console for details.

When I check the console, the output is as follows:

> Configure project :launcher
WARNING:The option setting 'android.aapt2FromMavenOverride=D:\Tool\Unity\2022.3.52f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\34.0.0\aapt2.exe' is experimental.

> Configure project :unityLibrary:GooglePlayGamesManifest.androidlib
WARNING:minSdkVersion (24) is greater than targetSdkVersion (16) for variant "debug". Please change the values such that minSdkVersion is less than or equal to targetSdkVersion.
WARNING:minSdkVersion (24) is greater than targetSdkVersion (16) for variant "release". Please change the values such that minSdkVersion is less than or equal to targetSdkVersion.
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 35

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

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=35
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 = 35

> Task :unityLibrary:preBuild UP-TO-DATE
~~~~
> Task :unityLibrary:GooglePlayGamesManifest.androidlib:processReleaseManifest
package="com.google.example.games.mainlibproj" found in source AndroidManifest.xml: D:\ApplicationUnity_SDK\Google\_GooglePlayGamesPlugin\GPG_0_11_01_U2022_3_52\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\GooglePlayGamesManifest.androidlib\AndroidManifest.xml.
Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.

~~~~
> Task :unityLibrary:GooglePlayGamesManifest.androidlib:compileReleaseJavaWithJavac
54 actionable tasks: 54 executed

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
FAILURE: Build completed with 3 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':unityLibrary:generateReleaseRFile'.
> Could not resolve all files for configuration ':unityLibrary:releaseCompileClasspath'.
   > Could not find com.google.games:gpgs-plugin-support:0.11.01.
     Required by:
         project :unityLibrary

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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.
==============================================================================

3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> Could not resolve all files 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://repo.maven.apache.org/maven2/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
       - file:/D:/ApplicationUnity_SDK/Google/_GooglePlayGamesPlugin/GPG_0_11_01_U2022_3_52/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/nor25/.m2/repository/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
       - file:/D:/ApplicationUnity_SDK/Google/_GooglePlayGamesPlugin/GPG_0_11_01_U2022_3_52/Library/Bee/Android/Prj/Mono2x/Gradle/unityLibrary/libs/gpgs-plugin-support-0.11.01.jar
       - file:/D:/ApplicationUnity_SDK/Google/_GooglePlayGamesPlugin/GPG_0_11_01_U2022_3_52/Library/Bee/Android/Prj/Mono2x/Gradle/unityLibrary/libs/gpgs-plugin-support.jar
     Required by:
         project :launcher > project :unityLibrary

* 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 8s

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
CommandInvokationFailure: Gradle build failed. 
D:\Tool\Unity\2022.3.52f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "D:\Tool\Unity\2022.3.52f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.5.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

Environment Variables:
~~~~

stderr[

FAILURE: Build completed with 3 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':unityLibrary:generateReleaseRFile'.
> Could not resolve all files for configuration ':unityLibrary:releaseCompileClasspath'.
   > Could not find com.google.games:gpgs-plugin-support:0.11.01.
     Required by:
         project :unityLibrary

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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.
==============================================================================

3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> Could not resolve all files 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://repo.maven.apache.org/maven2/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
       - file:/D:/ApplicationUnity_SDK/Google/_GooglePlayGamesPlugin/GPG_0_11_01_U2022_3_52/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/nor25/.m2/repository/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
       - file:/D:/ApplicationUnity_SDK/Google/_GooglePlayGamesPlugin/GPG_0_11_01_U2022_3_52/Library/Bee/Android/Prj/Mono2x/Gradle/unityLibrary/libs/gpgs-plugin-support-0.11.01.jar
       - file:/D:/ApplicationUnity_SDK/Google/_GooglePlayGamesPlugin/GPG_0_11_01_U2022_3_52/Library/Bee/Android/Prj/Mono2x/Gradle/unityLibrary/libs/gpgs-plugin-support.jar
     Required by:
         project :launcher > project :unityLibrary

* 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 8s
]
stdout[

> Configure project :launcher
WARNING:The option setting 'android.aapt2FromMavenOverride=D:\Tool\Unity\2022.3.52f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\34.0.0\aapt2.exe' is experimental.

> Configure project :unityLibrary:GooglePlayGamesManifest.androidlib
WARNING:minSdkVersion (24) is greater than targetSdkVersion (16) for variant "debug". Please change the values such that minSdkVersion is less than or equal to targetSdkVersion.
WARNING:minSdkVersion (24) is greater than targetSdkVersion (16) for variant "release". Please change the values such that minSdkVersion is less than or equal to targetSdkVersion.
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 35

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

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=35
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 = 35

> Task :unityLibrary:preBuild UP-TO-DATE
~~~~
> Task :unityLibrary:GooglePlayGamesManifest.androidlib:processReleaseManifest
package="com.google.example.games.mainlibproj" found in source AndroidManifest.xml: D:\ApplicationUnity_SDK\Google\_GooglePlayGamesPlugin\GPG_0_11_01_U2022_3_52\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\GooglePlayGamesManifest.androidlib\AndroidManifest.xml.
Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.

~~~~
> Task :unityLibrary:GooglePlayGamesManifest.androidlib:compileReleaseJavaWithJavac
54 actionable tasks: 54 executed
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <681810dba5f047c6addcc3cde9f9ce21>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <681810dba5f047c6addcc3cde9f9ce21>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <681810dba5f047c6addcc3cde9f9ce21>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <681810dba5f047c6addcc3cde9f9ce21>: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 <681810dba5f047c6addcc3cde9f9ce21>: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 <681810dba5f047c6addcc3cde9f9ce21>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <681810dba5f047c6addcc3cde9f9ce21>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <681810dba5f047c6addcc3cde9f9ce21>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Build completed with a result of 'Failed' in 47 seconds (46513 ms)
3 errors
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Best Regards crSudo

argzdev commented 2 weeks ago

@crSudo, this new error:

Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> Could not resolve all files 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://repo.maven.apache.org/maven2/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
       - file:/D:/ApplicationUnity_SDK/Google/_GooglePlayGamesPlugin/GPG_0_11_01_U2022_3_52/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/nor25/.m2/repository/com/google/games/gpgs-plugin-support/0.11.01/gpgs-plugin-support-0.11.01.pom
       - file:/D:/ApplicationUnity_SDK/Google/_GooglePlayGamesPlugin/GPG_0_11_01_U2022_3_52/Library/Bee/Android/Prj/Mono2x/Gradle/unityLibrary/libs/gpgs-plugin-support-0.11.01.jar
       - file:/D:/ApplicationUnity_SDK/Google/_GooglePlayGamesPlugin/GPG_0_11_01_U2022_3_52/Library/Bee/Android/Prj/Mono2x/Gradle/unityLibrary/libs/gpgs-plugin-support.jar
     Required by:
         project :launcher > project :unityLibrary

is now resolvable with the fix you've provided earlier.

Which is changing: <repository>Packages/com.google.play.games/Editor/m2repository</repository> to <repository>Assets/GooglePlayGames/com.google.play.games/Editor/m2repository</repository>

Also enabling the previous steps I mentioned earlier will also resolve this issue:

  1. Go to Assets > External Dependency Manager > Android Resolver > Settings, turn on When building Android app through Unity under Use Full Custom Local Maven Repo Path
crSudo commented 1 week ago

@argzdev

Thank you. After correcting GooglePlayGamesPluginDependencies.xml, I was able to build correctly. However, when I used the sample code, pressed the [Achievements]-[Ach ShowUI] button and executed Social.ShowAchievementsUI(), the following error occurred. \play-games-plugin-for-unity-0.11.01\play-games-plugin-for-unity-0.11.01\Samples\SmokeTest

E  AndroidJavaException: java.lang.ClassNotFoundException: com.google.games.bridge.HelperFragment
    java.lang.ClassNotFoundException: com.google.games.bridge.HelperFragment
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:607)
        at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
        at com.unity3d.player.UnityPlayer.-$$Nest$mnativeRender(Unknown Source:0)
        at com.unity3d.player.G0.handleMessage(Unknown Source:122)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loopOnce(Looper.java:205)
        at android.os.Looper.loop(Looper.java:294)
        at com.unity3d.player.H0.run(Unknown Source:24)
    Caused by: java.lang.ClassNotFoundException: com.google.games.bridge.HelperFragment
        at java.lang.Class.classForName(Native Method) 
        at java.lang.Class.forName(Class.java:607) 
        at com.unity3d.player.UnityPlayer.nativeRender(Native Method) 
        at com.unity3d.player.UnityPlayer.-$$Nest$mnativeRender(Unknown Source:0) 
        at com.unity3d.player.G0.handleMessage(Unknown Source:122) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loopOnce(Looper.java:205) 
        at android.os.Looper.loop(Looper.java:294) 
    at com.unity3d.player.H0.run(Unknown Source:24) 
    at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0 
    at UnityEngine.AndroidJNISafe.FindClass (System.String name) [0x00000] in <00000000000000000000000000000000>:0 
    at UnityEngine.AndroidJavaClass._AndroidJavaClass (Sys
I   [Play Games Plugin 0.11.01] 11/11/24 20:12:01 +09:00 DEBUG: ShowAchievementsUI callback is 
   GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
E  [17949]-[SurfaceView[jp.co.ofcr.cm00/com.unity3d.player.UnityPlayerActivity](BLAST)#17949]-timeRecords is at its maximum size[64]. Ignore this when unittesting.

I tried using external-dependency-manager-1.2.182.unitypackage and it worked correctly.

The environment is: ・Unity 2022.3.52f1 ・GooglePlayGamesPlugin-0.11.01.unitypackage ・external-dependency-manager-1.2.183.unitypackage Error occurred ・external-dependency-manager-1.2.182.unitypackage Works normally.

Best Regards crSudo

crSudo commented 1 week ago

@argzdev

Regarding minSdkVersion, external-dependency-manager-1.2.182 seems to work properly even with the default value of Android 5.1 API level 22.

Best Regards crSudo

argzdev commented 1 week ago

Thanks for confirming, @crSudo. Does it not work with 1.2.183?

For your new issue, could you file it in the Play Games repository. They'll be able to assist you better with issues specific to their SDK.

Thanks!

crSudo commented 1 week ago

@argzdev

Thanks for confirming, @crSudo. Does it not work with 1.2.183?

Yes. The error occurs in 1.2.183. The error does not occur in 1.2.182.

I am creating the environment using the method you instructed below. Is there anything I am doing wrong?

  1. Unity 2022.3.52f1:Create new Project: Launch on [Windows,Mac,Linux].
  2. Add GooglePlayGamesPlugin-0.11.01.unitypackage via Assets > Import Package > Custom Package...
  3. Delete External Dependency Manager folder under the Assets folder.
  4. Add external-dependency-manager-1.2.183.unitypackage via Assets > Import Package > Custom Package...
  5. Modified GooglePlayGamesPluginDependencies.xml \Assets\GooglePlayGames\com.google.play.games\Editor\GooglePlayGamesPluginDependencies.xml Modified to Assets/GooglePlayGames/com.google.play.games/Editor/m2repository
  6. Unity MenuBar [File]-[Build Settings] Select Android.
  7. Select [Switch Platform].
  8. [Enable Android Auto-resolution]: Select Enable.
  9. The [Google Version Handler] dialog will appear. Select Apply.
  10. Select [File]-[Build Settings]-[Player Settings] and change the Minimum API Level to [Android 7.0 API Level 24].
  11. Run Assets > External Dependency Manager > Android Resolver > Resolve.
  12. Run Assets > External Dependency Manager > Android Resolver > Force Resolve.
  13. Run [File]-[Build Setting]-[Build]

I also checked [When building Android app through Unity] in [Android Resolver Settings], but an error still occurs.

Best Regards crSudo

crSudo commented 1 week ago

@argzdev

I verified further. I changed the following line in \Assets\Plugins\Android\settingsTemplate.gradle and it worked correctly. url (unityProjectPath + "/Assets/GooglePlayGames/com.google.play.games/Editor/m2repository") // Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11 ↓ url (unityProjectPath + "/Assets/GeneratedLocalRepo/GooglePlayGames/com.google.play.games/Editor/m2repository") // Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11

It seems like the path setting process is the problem, what do you think?

Best Regards crSudo

argzdev commented 1 week ago

I did notice that. However, for me this appears as a warning. Since the path should be detected and corrected by the EDM4U automatically.

Screenshot 2024-11-15 at 9 09 32 PM

This means that the build will still continue even though this warning appears.

Full stacktrace:

Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11: Repo path 'Packages/com.google.play.games/Editor/m2repository' does not exist, will try using 'Assets/GooglePlayGames/com.google.play.games/Editor/m2repository' instead.
UnityEngine.Debug:LogWarning (object)
Google.Logger:Log (string,Google.LogLevel) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/VersionHandlerImpl/src/Logger.cs:129)
GooglePlayServices.PlayServicesResolver:Log (string,Google.LogLevel) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1077)
GooglePlayServices.GradleResolver:RepoPathToUri (string,string) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/GradleResolver.cs:230)
GooglePlayServices.GradleResolver:DependenciesToRepoUris (System.Collections.Generic.IEnumerable`1<Google.JarResolver.Dependency>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/GradleResolver.cs:279)
GooglePlayServices.PlayServicesResolver:GetRepos (System.Collections.Generic.IEnumerable`1<Google.JarResolver.Dependency>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2209)
GooglePlayServices.LocalMavenRepository:FindLocalRepos (System.Collections.Generic.ICollection`1<Google.JarResolver.Dependency>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/LocalMavenRepository.cs:41)
GooglePlayServices.LocalMavenRepository:FindAarsInLocalRepos (System.Collections.Generic.ICollection`1<Google.JarResolver.Dependency>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/LocalMavenRepository.cs:76)
GooglePlayServices.LocalMavenRepository:PatchPomFilesInLocalRepos (System.Collections.Generic.ICollection`1<Google.JarResolver.Dependency>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/LocalMavenRepository.cs:191)
GooglePlayServices.PlayServicesResolver:DeleteResolvedLibrariesFromGradleTemplate (bool,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1680)
GooglePlayServices.PlayServicesResolver:ResolveUnsafe (System.Action`1<bool>,bool,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2023)
GooglePlayServices.PlayServicesResolver:ResolveUnsafeAfterPromptCheck (System.Action`1<bool>,bool,bool,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1944)
GooglePlayServices.PlayServicesResolver/<>c__DisplayClass113_0:<ResolveUnsafeAfterJetifierCheck>b__0 (bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1853)
GooglePlayServices.PlayServicesResolver/<>c__DisplayClass144_0:<CanEnableJetifierOrPromptUser>b__1 (GooglePlayServices.PlayServicesResolver/ApiLevelJetifierResult) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2825)
GooglePlayServices.PlayServicesResolver:CheckApiLevelForJetifier (bool,string,System.Action`1<GooglePlayServices.PlayServicesResolver/ApiLevelJetifierResult>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2789)
GooglePlayServices.PlayServicesResolver/<>c__DisplayClass144_0:<CanEnableJetifierOrPromptUser>b__0 (bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2810)
GooglePlayServices.PlayServicesResolver:CheckGradleVersionForJetifier (bool,string,System.Action`1<bool>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2717)
GooglePlayServices.PlayServicesResolver:CanEnableJetifierOrPromptUser (string,System.Action`1<bool>) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2808)
GooglePlayServices.PlayServicesResolver:ResolveUnsafeAfterJetifierCheck (System.Action`1<bool>,bool,bool,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1850)
GooglePlayServices.PlayServicesResolver:ResolveUnsafeAfterMainTemplateCheck (System.Action`1<bool>,bool,bool,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1796)
GooglePlayServices.PlayServicesResolver/<>c__DisplayClass110_0:<ScheduleResolve>b__1 () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1751)
GooglePlayServices.PlayServicesResolver:ExecuteNextResolveJob () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1598)
GooglePlayServices.PlayServicesResolver:ScheduleResolve (bool,bool,System.Action`1<bool>,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1764)
GooglePlayServices.PlayServicesResolver:AutoResolve (System.Action) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1258)
GooglePlayServices.PlayServicesResolver/<>c:<ScheduleAutoResolve>b__86_1 () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1237)
Google.RunOnMainThread:ExecutePollingJobs () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:409)
Google.RunOnMainThread/<>c:<ExecuteAllUnnested>b__28_0 () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:541)
Google.RunOnMainThread:RunAction (System.Action) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
Google.RunOnMainThread:ExecuteAllUnnested (bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
Google.RunOnMainThread:ExecuteAll () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:512)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions () (at /Users/bokken/build/output/unity/unity/Editor/Mono/EditorApplication.cs:381)

It should be detected by this code in the Gradle Resolver. https://github.com/googlesamples/unity-jar-resolver/blob/3e97c8d815ca4a947ff93fd468e7b2e108b39150/source/AndroidResolver/src/GradleResolver.cs#L231

There should be no need to manually change the file path. Can you verify if there's only a single version of EDM4U under Assets > ExternalDependencyManager > Editor

Screenshot 2024-11-15 at 11 32 53 PM
crSudo commented 6 days ago

Thank you for your research, @argzdev.

When I set the data in [Resources Definition] in the Unity menu bar [Windows]-[Google Play Games]-[Setup]-[Android setup], GooglePlayGamesPluginDependencies.xml was automatically corrected and the error disappeared. However, when I run the Sample [Achievements]-[Ach ShowUI], the following error occurs.

SmokeTest.AchievementGUI:OnGUI()
AndroidJavaException: java.lang.ClassNotFoundException: com.google.games.bridge.HelperFragment
java.lang.ClassNotFoundException: com.google.games.bridge.HelperFragment
    at java.lang.Class.classForName(Native Method)
    at java.lang.Class.forName(Class.java:607)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.-$$Nest$mnativeRender(Unknown Source:0)
    at com.unity3d.player.G0.handleMessage(Unknown Source:122)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at com.unity3d.player.H0.run(Unknown Source:24)
Caused by: java.lang.ClassNotFoundException: com.google.games.bridge.HelperFragment
    at java.lang.Class.classForName(Native Method) 
    at java.lang.Class.forName(Class.java:607) 
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method) 
    at com.unity3d.player.UnityPlayer.-$$Nest$mnativeRender(Unknown Source:0) 
    at com.unity3d.player.G0.handleMessage(Unknown Source:122) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loopOnce(Looper.java:205) 
    at android.os.Looper.loop(Looper.java:294) 
    at com.unity3d.player.H0.run(Unknown Source:24) 
  at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.AndroidJNISafe.FindClass (System.String name) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.AndroidJavaClass._AndroidJavaClass (Sys
 [Play Games Plugin 0.11.01] 11/16/24 18:06:41 +09:00 DEBUG: ShowAchievementsUI callback is 
GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()

The steps are as follows:

  1. Create new Project: Launch on [Windows,Mac,Linux].
  2. Add GooglePlayGamesPlugin-0.11.01.unitypackage via Assets > Import Package > Custom Package...
  3. Delete External Dependency Manager folder under the Assets folder.
  4. Add external-dependency-manager-1.2.183.unitypackage via Assets > Import Package > Custom Package...
  5. Unity MenuBar [File]-[Build Settings] Select Android.
  6. Select [Switch Platform].
  7. [Enable Android Auto-resolution]: Select Enable.
  8. The [Google Version Handler] dialog will appear. Select Apply.
  9. Unity MenuBar [Windows]-[Google Play Games]-[Setup]-[Android setup]:[Resources Definition] settings
  10. [Set Bundle Identifier] dialog will appear. Select OK.
  11. Select Unity MenuBar [File]-[Build Settings]-[Player Settings] [Orther Settings] [Minimum API Level] : [Android 7.0 API Level 24]. [Scripting Backend] : IL2CPP [Target Architectures]: Check ARMv64 [Publish Settings] I set [Project Keystore] and [Project Key].
  12. Run Assets > External Dependency Manager > Android Resolver > Resolve.
  13. Run Assets > External Dependency Manager > Android Resolver > Force Resolve.
  14. Run [File]-[Build Setting]-[Build]

However, if you manually change the path in \Assets\Plugins\Android\settingsTemplate.gradle as follows, it seems to work correctly. url (unityProjectPath + "/Assets/GeneratedLocalRepo/GooglePlayGames/com.google.play.games/Editor/m2repository")

Best Regards crSudo