playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.46k stars 966 forks source link

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

Open CoreySmith1200 opened 6 days ago

CoreySmith1200 commented 6 days ago

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 commented 5 days ago

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

lupulv commented 4 days ago

Same, fix please

brend32 commented 4 days ago

Same issues. Don't work ShowLeaderboardUI and ShowAchievementsUI

leo3duy commented 4 days ago

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 commented 2 days ago

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 commented 2 days ago

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 commented 1 day ago

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 commented 1 day ago

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 commented 1 day ago

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

PoweredByAndrox commented 1 day ago

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!