Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShowLeaderboardUI() AndroidJavaException: java.lang.ClassNotFoundException: com.google.games.bridge.HelperFragment #3318

Open
CoreySmith1200 opened this issue Oct 15, 2024 · 15 comments
Labels

Comments

@CoreySmith1200
Copy link

CoreySmith1200 commented Oct 15, 2024

Authenticate and report scores works fine. But when I try to call PlayGamesPlatform.Instance.ShowLeaderboardUI() or Social.ShowLeaderboardU() I get error AndroidJavaException: java.lang.ClassNotFoundException:com.google.games.bridge.HelperFragment. I have tried using the Social heavy method and also exclusively using PlayGamesPlatform.Instance methods, none can open a leaderboard and give same error. I am able to upload to internal testing in goole play and test on dev device without google play saying errors.

My project main template gradle uses the new play core that is fragmented (not using 1.10.3)
implementation 'com.google.android.play:core-common:2.0.4' // Assets/GooglePlayPlugins/com.google.play.core/Editor/Dependencies.xml:3

Unity 2022.3.50
Android min SDK 24
Android target SDK 34
Play games plugin 0.11.01
EDM4U 1.2.183
also using firebase analytics 12.3.0
also using google play review plugin 1.8.3

I previously was using Unity 2021.3.33 with target SDK 33 and min sdk 22 and firebase 12.0 and everything was working. Note: I have same exact issue when try to upgrade using Unity 2021.3.44 when min SDK 24, target SDK 34, and also updating firebase analytics to 12.3.

I have seen some potentially similar issues but none of their suggestions have had success for me. Generated Local Repo folder is including both gpgs-plugin-support-0.11.01 files with vanilla setup.

error from showLeaderboard

here is my mainTemplate.grade after a force resolve:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
// Android Resolver Dependencies Start
    implementation 'com.applovin.mediation:google-adapter:[23.4.0.0]' // Assets/MaxSdk/Mediation/Google/Editor/Dependencies.xml:5
    implementation 'com.applovin.mediation:unityads-adapter:4.12.3.1' // Assets/MaxSdk/Mediation/UnityAds/Editor/Dependencies.xml:4
    implementation 'com.applovin:applovin-sdk:13.0.0' // Assets/MaxSdk/AppLovin/Editor/Dependencies.xml:4
    implementation 'com.google.android.gms:play-services-base:18.5.0' // Assets/Firebase/Editor/AppDependencies.xml:17
    implementation 'com.google.android.play:core-common:2.0.4' // Assets/GooglePlayPlugins/com.google.play.core/Editor/Dependencies.xml:3
    implementation 'com.google.android.play:review:2.0.0' // Assets/GooglePlayPlugins/com.google.play.review/Editor/Dependencies.xml:3
    implementation 'com.google.android.ump:user-messaging-platform:2.+' // Assets/MaxSdk/AppLovin/Editor/Dependencies.xml:5
    implementation 'com.google.firebase:firebase-analytics:22.1.0' // Assets/Firebase/Editor/AppDependencies.xml:15
    implementation 'com.google.firebase:firebase-analytics-unity:12.3.0' // Assets/Firebase/Editor/AnalyticsDependencies.xml:18
    implementation 'com.google.firebase:firebase-app-unity:12.3.0' // Assets/Firebase/Editor/AppDependencies.xml:22
    implementation 'com.google.firebase:firebase-common:21.0.0' // Assets/Firebase/Editor/AppDependencies.xml:13
    implementation 'com.google.games:gpgs-plugin-support:0.11.01' // Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11
    implementation 'com.tenjin:android-sdk:1.16.1' // Assets/Editor/Dependencies.xml:4
// Android Resolver Dependencies End
**DEPS**
}
@nicetrysean
Copy link

Same issue here, not only the Leaderboards but also the Achievements

@lupulv
Copy link

lupulv commented Oct 16, 2024

Same, fix please

@brend32
Copy link

brend32 commented Oct 16, 2024

Same issues. Don't work ShowLeaderboardUI and ShowAchievementsUI

@leo3duy
Copy link

leo3duy commented Oct 16, 2024

Same here... Uploading a project from API 33 to 34 has led me to encounter the same issue.

Unity 2021.3.44f1
Play games plugin 0.11.01
EDM4U 1.2.183

@PoweredByAndrox
Copy link

I found out that the com.google.games.* package is not persisted in the DEX classes of AAB build file and why is this happen... (you can just decompile it for check the package path to class)

@frazerbw
Copy link

Exact same issue, and with the looming November deadline to upgrade to SDK34, this is quite urgent.. tried many things. I'll report back if I have any luck.. but hopefully someone can help us soon.

@leo3duy
Copy link

leo3duy commented Oct 19, 2024

What I found is that the file containing the com.google.games.* classes is not included in the final AAB. It seems that EDM4U doesn’t properly resolve the GPGS plugin.

I tried the workaround of copying the gpgs-plugin-support-0.11.01.aar and POM files from:

Assets/GeneratedLocalRepo/GooglePlayGames/... (where the AAR files are supposed to be taken from during the build)

to:

Assets/GooglePlayGames/... (where it actually seems to be taking the AAR files from)

I rebuilt the project in Android Studio, and now the achievements UI and leaderboard open correctly. (I still need to do more thorough testing), but everything seems to be working so far.

@frazerbw
Copy link

frazerbw commented Oct 19, 2024

It worked

What I found is that the file containing the com.google.games.* classes is not included in the final AAB. It seems that EDM4U doesn’t properly resolve the GPGS plugin.

I tried the workaround of copying the gpgs-plugin-support-0.11.01.aar and POM files from:

Assets/GeneratedLocalRepo/GooglePlayGames/... (where the AAR files are supposed to be taken from during the build)

to:

Assets/GooglePlayGames/... (where it actually seems to be taking the AAR files from)

I rebuilt the project in Android Studio, and now the achievements UI and leaderboard open correctly. (I still need to do more thorough testing), but everything seems to be working so far.

Thankyou so much! This worked!

One tip for other people, as this caught me out initially. When I 'force resolved' after doing the copy paste, I ended up breaking things.

Don't do this. Just copy paste over the POM and AAR (you don't need the meta files). Then build your aab/apk file.

Tested this on the internal track and it worked! :) Very happy!

@imenekse
Copy link

I solved this issue by using External Dependency Manager v1.2.177

@PoweredByAndrox
Copy link

What I found is that the file containing the com.google.games.* classes is not included in the final AAB. It seems that EDM4U doesn’t properly resolve the GPGS plugin.

I tried the workaround of copying the gpgs-plugin-support-0.11.01.aar and POM files from:

Assets/GeneratedLocalRepo/GooglePlayGames/... (where the AAR files are supposed to be taken from during the build)

to:

Assets/GooglePlayGames/... (where it actually seems to be taking the AAR files from)

I rebuilt the project in Android Studio, and now the achievements UI and leaderboard open correctly. (I still need to do more thorough testing), but everything seems to be working so far.

Thanks to @frazerbw and @leo3duy for solve this bug. It really works!

@smuttleralph
Copy link

fixed it by checking the 'Android' box under 'Select platform for plugin' in the inspector for gpgs-plugin-support-0.11.01.aar

@domalagic
Copy link

I solved this issue by using External Dependency Manager v1.2.177

This worked for me as well! Thank you very much.

@ValeriyBogorodskiy
Copy link

ValeriyBogorodskiy commented Nov 25, 2024

Solution that survived force resolution is

  1. Move plugin files from Assets/GooglePlayGames/com.google.play.games/Editor/m2repository to Assets/GooglePlayGames/m2repository
  2. Update repository path in GooglePlayGamesPluginDependencies.xml from
        <repository>Assets/GooglePlayGames/com.google.play.games/Editor/m2repository</repository>

to

        <repository>Assets/GooglePlayGames/m2repository</repository>
  1. Resolve dependencies

We are using:

Unity 2021.3.44f1
Play games plugin 0.11.01
EDM4U 1.2.183

(tagging #3092 for visibility)

@damozhang
Copy link

fixed it by checking the 'Android' box under 'Select platform for plugin' in the inspector for gpgs-plugin-support-0.11.01.aar

I use 2.0.0, and this worked for me!

@onerbatuhan
Copy link

onerbatuhan commented Jan 8, 2025

fixed it by checking the 'Android' box under 'Select platform for plugin' in the inspector for gpgs-plugin-support-0.11.01.aar

I am also using version 2.0.0, it worked! Thank you.
But an important warning, if you force resolve, the settings will revert to their previous state. You may need to check again before you build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests