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

Didn't find class "org/godotengine/godot/PlayGameServices" #15

Closed
tx350z opened this issue Apr 8, 2020 · 2 comments
Closed

Didn't find class "org/godotengine/godot/PlayGameServices" #15

tx350z opened this issue Apr 8, 2020 · 2 comments

Comments

@tx350z
Copy link

tx350z commented Apr 8, 2020

Thank you for the hard work building this plug-in.

Tried several times to implement the plug-in in my app. Logcat reports singleton PlayGameServices is not found. Verified "org/godotengine/godot/PlayGameServices" is in the modules list. Compared the project settings with the Demo included in the zip and can't find any differences. I tried both the PlayGamesSvcsGP-master and the PGSGP-1.2.0 versions with the same result.

Reviewed APK class.dex and did not find PlayGameServices listed. All the other the plug-in classes ARE listed in class.dex. Only PlayGameServices is missing.

Logcat out put is below (my game package names have been obfuscated). Any suggestions?

2020-04-08 08:44:26.778 13231-13255/? E/godot: ERROR: Couldn't find singleton for class: org/godotengine/godot/PlayGameServices.
2020-04-08 08:44:26.778 13231-13255/? E/godot: At: platform/android/java_godot_lib_jni.cpp:691:_initialize_java_modules() - Condition "!singletonClass" is true. Continuing.
2020-04-08 08:44:26.781 13231-13255/? E/AndroidRuntime: FATAL EXCEPTION: GLThread 12004
Process: xxxxxxx.games.xxxx, PID: 13231
java.lang.ClassNotFoundException: Didn't find class "org/godotengine/godot/PlayGameServices" on path: DexPathList[[zip file "/data/app/xxxxxxx.games.xxxx-CxyZsnOEOvQSouq0KSVcNA==/base.apk"],nativeLibraryDirectories=[/data/app/xxxxxxx.games.xxxx-CxyZsnOEOvQSouq0KSVcNA==/lib/arm, /data/app/xxxxxxx.games.xxxx-CxyZsnOEOvQSouq0KSVcNA==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at org.godotengine.godot.GodotLib.setup(Native Method)
at org.godotengine.godot.Godot$2.run(Godot.java:325)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1500)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)

@cgisca
Copy link
Owner

cgisca commented Apr 8, 2020

Hi,
have you followed the setup steps from README.md file?

Have you added org/godotengine/godot/PlayGameServices as described below:
In Godot Engine, go to Project -> Project Settings. Then on the tab General go to the Android section, and fill the Modules part with org/godotengine/godot/PlayGameServices

Also check that in the Project > Export dialog, Custom Build is enabled

@tx350z
Copy link
Author

tx350z commented Apr 8, 2020

I did follow the instructions.
I managed to solve the problem in the following way:

  1. copy android-pgs-plugin into the android folder
  2. put the GPGS app ID in android-pgs-plugin/res/ids.xml
  3. Delete folder android/build
  4. Reinstall Android Build Template
  5. Add these two lines to android/build/gradle.properties
    android.useAndroidX=true
    android.enableJetifier=true
  6. Do an Android export - all is good and the singleton class appears in the APK classes.dex

It seems the Android Build Template has to be reinstalled after the plugin folder in the android folder. But can't be to export until the gradle.properties are changed. There needs to be an option to rebuild the template without deleting the android/build directory. But that's not a problem with your plugin.

Closing this issue.

Thanks again!

@tx350z tx350z closed this as completed Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants