HaxeExtension / extension-googleplaygames

OpenFL extension for Google Play Games / Android
Other
53 stars 17 forks source link

Crashes on boot login at random times #16

Closed smks closed 9 years ago

smks commented 9 years ago

I/EXTENSION-GOOGLEPLAYGAMES( 1531): PlayGames: Forcing Login V/NME ( 1531): Send on lost I/art ( 1531): Rejecting re-init on previously-failed class java.lang.Class I/art ( 1531): Rejecting re-init on previously-failed class java.lang.Class W/PopupManager( 1531): You have not specified a View to use as content view for popups. Falling back to the Activity content view. Note that this may not wor k as expected in multi-screen environments D/AndroidRuntime( 1531): Shutting down VM E/AndroidRuntime( 1531): FATAL EXCEPTION: main E/AndroidRuntime( 1531): Process: com.smks.ronnietherooster, PID: 1531 E/AndroidRuntime( 1531): java.lang.NullPointerException: Attempt to invoke virtual method 'void com.gpgex.GameHelper.setMaxAutoSignInAttempts(int)' on a null object reference E/AndroidRuntime( 1531): at com.gpgex.GooglePlayGames$1.run(GooglePlayGames.java:53) E/AndroidRuntime( 1531): at android.os.Handler.handleCallback(Handler.java:739) E/AndroidRuntime( 1531): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 1531): at android.os.Looper.loop(Looper.java:145) E/AndroidRuntime( 1531): at android.app.ActivityThread.main(ActivityThread.java:6134) E/AndroidRuntime( 1531): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 1531): at java.lang.reflect.Method.invoke(Method.java:372) E/AndroidRuntime( 1531): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) E/AndroidRuntime( 1531): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194) V/ApplicationPolicy( 923): isApplicationStateBlocked userId 0 pkgname com.smks.ronnietherooster I/SurfaceFlinger( 230): id=73 Removed sonniethero (8/11) I/SurfaceFlinger( 230): id=73 Removed sonniethero (-2/11) W/ActivityManager( 923): Force finishing activity com.smks.ronnietherooster/.MainActivity

fbricker commented 9 years ago

Hi, (once again)... please provide details about your environment so we can try to help you. Consider including: 1) haxe, nme and openfl version 2) if you're using openfl next or legacy 3) Do you have the last version of "google play services lib" installed from your android package manager?

Also, just in case: Is it possible that you're calling some methods of the extension before calling the init() ?

Thanks

smks commented 9 years ago

I noticed this issue would only occur when I call initAndroid() and login() directly after each other. I have called init on app bootup, and now try to log in at the main menu and no crashing has occurred yet.

fbricker commented 9 years ago

Fixed! :+1: Calling login right after init generated a race condition which caused an un uncaught exception (sometimes). Even if the the best practice is to call init on the main function and later on call login on another screen, it's now safe to call them together.

PS: New version (1.3.4) has been published to github and uploaded to haxelib :)

Thanks for reporting! Federico