Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

From The Blog: New Google Play Games Services plugin
Started by CoronaBot Oct 04 2018 06:50 AM

59 replies to this topic
[TOPIC CONTROLS]
Page 3 of 3 1 2 3
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#51

Sheekore

[GLOBAL: userInfoPane.html]
Sheekore
  • Enthusiast

  • 79 posts
  • Corona SDK

@Rob

I am using 2018.3425.

According to the blog post I have removed gpgs.init and directly calling gpgs.login.

- When the app is logged in then everything works that is achievements, leaderboards and snapshots are shown. When I logout, I cannot log back in again. This is due to the gpgs.isConnected ( I don't know how to check whether the current user is logged in using updated gpgs-v2, I used gpgs.isConnected whether the user is logged in ) since it returns true always. When I close the app and restart again being signed out, when I go to the screen where I have the login button the app crashes giving the following error. When I tap the default prompt to restart the app, the app launches and the default the gpgs login procedure starts again, then after selecting the account, there is successful login to gpgs.

When I logout the whole app crash cycle starts again when I follow the above steps. 


error log:

11-02 20:01:28.217 11891 11907 I Corona  : ERROR: Runtime error
11-02 20:01:28.218 11891 11907 I Corona  : java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.ContextWrapper.getApplicationContext()' on a null object reference
11-02 20:01:28.218 11891 11907 I Corona  : Java Stack Trace:
11-02 20:01:28.218 11891 11907 I Corona  :      plugin.gpgs.v2.Connector.getContext(Connector.java:58)
11-02 20:01:28.218 11891 11907 I Corona  :      plugin.gpgs.v2.Connector.getSignInAccount(Connector.java:62)
11-02 20:01:28.218 11891 11907 I Corona  :      plugin.gpgs.v2.Connector.isAuthenticated(Connector.java:54)
11-02 20:01:28.218 11891 11907 I Corona  :      plugin.gpgs.v2.Utils.checkConnection(Utils.java:52)
11-02 20:01:28.218 11891 11907 I Corona  :      plugin.gpgs.v2.Snapshots.open(Snapshots.java:162)
11-02 20:01:28.218 11891 11907 I Corona  :      plugin.gpgs.v2.Snapshots.access$100(Snapshots.java:36)
11-02 20:01:28.218 11891 11907 I Corona  :      plugin.gpgs.v2.Snapshots$2.invoke(Snapshots.java:51)
11-02 20:01:28.218 11891 11907 I Corona  :      com.ansca.corona.JavaToNativeShim.nativeTouchEvent(Native Method)
11-02 20:01:28.218 11891 11907 I Corona  :      com.ansca.corona.JavaToNativeShim.touchEvent(JavaToNativeShim.java:430)
11-02 20:01:28.218 11891 11907 I Corona  :      com.ansca.corona.input.RaiseTouchEventTask.executeUsing(RaiseTouchEventTask.java:39)
11-02 20:01:28.218 11891 11907 I Corona  :      com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:170)
11-02 20:01:28.218 11891 11907 I Corona  :      com.ansca.corona.events.EventManager.sendEvents(EventManager.java:91)
11-02 20:01:28.218 11891 11907 I Corona  :      com.ansca.corona.Controller.updateRuntimeState(Controller.java:318)
11-02 20:01:28.218 11891 11907 I Corona  :      com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:425)
11-02 20:01:28.218 11891 11907 I Corona  :      com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1625)
11-02 20:01:28.218 11891 11907 I Corona  :      com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1380)
11-02 20:01:28.218 11891 11907 I Corona  : stack traceback:
11-02 20:01:28.218 11891 11907 I Corona  :      [C]: ?
11-02 20:01:28.218 11891 11907 I Corona  :      [C]: in function 'open'
11-02 20:01:28.218 11891 11907 I Corona  :      ?: in function <?:786>
11-02 20:01:28.218 11891 11907 I Corona  :      ?: in function <?:727>
11-02 20:01:28.218 11891 11907 I Corona  :      ?: in function 'method'
11-02 20:01:28.218 11891 11907 I Corona  :      /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:221: in function 'dispatchEvent'
11-02 20:01:28.218 11891 11907 I Corona  :      /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/composer/composer.lua:906: in function '_nextTransition'
11-02 20:01:28.218 11891 11907 I Corona  :      /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/composer/composer.lua:1499: in function 'transitionNewScene'
11-02 20:01:28.218 11891 11907 I Corona  :      /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/composer/composer.lua:1531: in function 'gotoScene'
11-02 20:01:28.218 11891 11907 I Corona  :      ?: in function '_onEvent'
11-02 20:01:28.218 11891 11907 I Corona  :      /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/widget/widgetLibrary/widget_button.lua:120: in function 'manageButtonTouch'
11-02 20:01:28.218 11891 11907 I Corona  :      /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/widget/widgetLibrary/widget_button.lua:881: in function 'method'
11-02 20:01:28.218 11891 11907 I Corona  :      /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:221: in function </Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:190>


[TOPIC: post.html]
#52

steinovehelset

[GLOBAL: userInfoPane.html]
steinovehelset
  • Observer

  • 14 posts
  • Corona SDK

I also struggled a lot with this issue.
W plugin.gpgs.v2: Not connected

 

But I found a solution. Maybe it doesn't help you, but might be worth a look.

When you create a project in Google Play Console, a project is also automatically created in the Google Developer Console/Google Cloud Platform. This project is connected to your game through the signing key (SPA1). But when you release your game and choose to use Google Play App Signing it seems that the original key changes and you need to merge the upload.der with your original keystore.

 

When this is done, the fingerprint inside Google Developer Console/Google Cloud Platform no longer matches the one in Google Play Console.

 

So you need to update the OAuth credentials for the Drive API and Google Play Game Services. Inside the Google Developer Console/Google Cloud Platform you need to choose your project and go to credentials. There you should find an entry matching the name of your project.

 

If you click your project, you can update the signing-certificate fingerprint with the new one from Google Play Console.

 

--

 

Sorry for my English and probably not the best explanation. If anything is unclear please let me know and I'll try to help you.
 



[TOPIC: post.html]
#53

Sheekore

[GLOBAL: userInfoPane.html]
Sheekore
  • Enthusiast

  • 79 posts
  • Corona SDK

@steinovehelset

Thank you for your message. I am using 2018.3425 and with this build the gpgs.v2:not connected issue goes away. I am struggling with only how to check whether the user is logged in or not. If logged in, the gpgs functionality works as expected, only when logging out causes the issues I am having currently.



[TOPIC: post.html]
#54

santiagojrodriguez

[GLOBAL: userInfoPane.html]
santiagojrodriguez
  • Observer

  • 7 posts
  • Corona SDK

Hi guys, I'm using the 2018.3427 version and still get the "Not connected" message.
 
The relevant part of my code is:
 
 

if not event.isError then
        if ( event.name == "login" ) then  -- Successful login event
            print( "AFTER LOGIN AND ABOUT TO SHOW LEADERBOARDS ")
            if (globalData.gpgs.isConnected()) then
                print("IT IS CONNECTED")
                globalData.gpgs.leaderboards.show()
            else
                print("NOT CONNECTED")
            end
        end
    end


 
And in the ADB Log I'm seeing:

 

I/Corona  (32443): IT IS CONNECTED
W/plugin.gpgs.v2(32443): Not connected

 
I'm also unable to see the Google Leaderboards. I'm assuming it's related to being not connected. I've checked everything that was mentioned on this thread. I'll try removing and recreating both the App and Service on the Google Play Console to see if that is the problem. If you have any other recommendation for me, please let me know :)
 
Thanks.



[TOPIC: post.html]
#55

steinovehelset

[GLOBAL: userInfoPane.html]
steinovehelset
  • Observer

  • 14 posts
  • Corona SDK

I have also noticed that the "Drive API" in Google developer console isn't always added automatically. So remember to check if this has been enabled. It may take some minutes from enabling before it actually starts working.

 

And you also have to remember to build the app with a release key, upload it to Google Play (alpha testing, internal or what ever) and download it from there. This was the only way I could make it work. Just transferring it to the mobile didn't work.



[TOPIC: post.html]
#56

santiagojrodriguez

[GLOBAL: userInfoPane.html]
santiagojrodriguez
  • Observer

  • 7 posts
  • Corona SDK

No luck, I'm still stuck in the "Connected / Not Connected" issue,

 

@steinovehelset: I re-checked that the Drive API is enabled, and I'm building with the Release Key, so it's not that. Thanks anyway.



[TOPIC: post.html]
#57

steinovehelset

[GLOBAL: userInfoPane.html]
steinovehelset
  • Observer

  • 14 posts
  • Corona SDK

I have also noticed that the "Drive API" in Google developer console isn't always added automatically. So remember to check if this has been enabled. It may take some minutes from enabling before it actually starts working.

 

And you also have to remember to build the app with a release key, upload it to Google Play (alpha testing, internal or what ever) and download it from there. This was the only way I could make it work. Just transferring it to the mobile didn't work.

 

Did you try to upload the build to Google Play, and install it that way? Just transferring it to your mobile doesn't work!



[TOPIC: post.html]
#58

santiagojrodriguez

[GLOBAL: userInfoPane.html]
santiagojrodriguez
  • Observer

  • 7 posts
  • Corona SDK

Yes, I'm downloading it from Google Play as a Beta release.

 

I get to see the Google Play connection popup, and then the screen goes black and I get the "Not connected" error on the log.

 

Tonight I'll try removing everything that it's not relevant and uploading a single screen that connects to Google Play and submits a hardcoded score, using the code from the Tutorial.



[TOPIC: post.html]
#59

santiagojrodriguez

[GLOBAL: userInfoPane.html]
santiagojrodriguez
  • Observer

  • 7 posts
  • Corona SDK

Hi guys! I could solve my issue.  
 
I suppose it was a combination of things, but the last problem was that at some point I "restarted" everything on Google Play Console but I was using the old SHA1 key for my original app.  :unsure:
 
Thanks for your help!!


[TOPIC: post.html]
#60

Sheekore

[GLOBAL: userInfoPane.html]
Sheekore
  • Enthusiast

  • 79 posts
  • Corona SDK

Does anyone know how to check whether the current user is logged in or not in this new plugin, since gpgs.isConnected returns true always if gpgs is present in the device?




[topic_controls]
Page 3 of 3 1 2 3
 
[/topic_controls]