2
votes

I'm trying to implement social media login in a CodenameOne app using Google+ as explained here but I can't get it to work.

Sometimes, I get a dialog with all the active google accounts on the device (there are multiple of them) after which I get a null pointer exception. From the adb logs, the NPE occurs because the getAccessToken() method of the GoogleConnect instance is null when I try accessing it in the loginSuccessful() callback.

Other times, the app simply freezes after calling GoogleConnect.doLogin() and there's nothing in the logs suggesting what is going wrong. Everything works fine in the simulator and on iOS.

Has anyone experienced similar issues and does anyone know how I can solve it?

2

2 Answers

0
votes

I think this is related to the back and forth issues with the gradle support. We deployed a new version yesterday which should restore gradle functionality and hopefully fix this issue.

0
votes

What solved the problem for me was explicitly defining build hint android.playService.plus instead of using android.includeGPlayServices=true (cf. https://www.codenameone.com/blog/a-thank-you-an-important-update-on-android-builds.html)

PS: The information on the Google+ login blog (http://www.codenameone.com/google-login.html) needs to be updated.