Rob,
No, I’m not.
One more side note, the same code rebuilt using the v1 edition works fine.
Rob,
No, I’m not.
One more side note, the same code rebuilt using the v1 edition works fine.
Are you getting any error messages?
Rob
I also tried internal testing and downloading from Google Play, but behavior is the same. Both isConnected() and leaderboards.show()
I took @lmgualandi’s sample app. When I connect to my existing app in Google Play, it works fine. isConnected() returns true, leaderboard show.
I went into my Google Play dashboard and created a new app, used the new credentials and I always get .isConnected() returning false. This leads me to believe there is a setup issue. Now it could be I need to give Google more time to push everything through, so I will try again tomorrow. I’ll also try and compare my working app with the new one and see if I can find some settings that are different.
Rob
I’m having the same issue with the leaderboard not showing up. However, my code is totally different from Rob’s and from the Corona Tutorial (I’m surprised!); I’ve used this code for a few years, based on a tutorial here.
local playerName local function loadLocalPlayerCallback( event ) playerName = event.data.alias g.loggedIntoGC = true print("Logged into Google Game Services") end local function gameNetworkLoginCallback( event ) gameNetwork.request( "loadLocalPlayer", { listener=loadLocalPlayerCallback } ) return true end local function gpgsInitCallback( event ) gameNetwork.request( "login", { userInitiated=true, listener=gameNetworkLoginCallback } ) end local function gameNetworkSetup() if device.isAndroid then gameNetwork.init( "google", gpgsInitCallback ) else gameNetwork.init( "gamecenter", gameNetworkLoginCallback ) end end local function onSystemEvent( event ) if ( event.type == "applicationSuspend" ) then elseif ( event.type == "applicationResume" ) then elseif ( event.type == "applicationExit" ) then elseif ( event.type == "applicationStart" ) then gameNetworkSetup() --login to the network here end return true end Runtime:addEventListener( "system", onSystemEvent )
When trying to show leaderboard, logcat shows:
10-14 23:49:11.042 11244 13377 W plugin.gpgs.v2: Not connected
Can you try again? Our engineer pushed a change that may address it. In my test app, it’s now reporting true for .isConnected()
Rob
Nope, still not working here for me: “Not connected” (Using the same build)
I re-installed my app from the Play Store which has the v1 GPGS plugin and it successfully shows the leaderboard.
EDIT: Also it works if I build my app with v1.
It would really help if you could provide some debugging information like looking through your device’s console log for messages from Google Play.
Rob
I was looking for something of significance in the log but didn’t find anything.
Here’s what I got just now, using ‘adb logcat Corona:v *:w’
10-15 21:57:45.251 590 629 E ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only 10-15 21:57:45.253 1451 2873 E ANDR-PERF-JNI: com\_qualcomm\_qtiperformance\_native\_perf\_io\_prefetch\_start 10-15 21:57:45.257 1451 2873 E ActivityTrigger: activityStartTrigger: not whiteListed\<my app id\>/com.ansca.corona.CoronaActivity/23 10-15 21:57:45.257 1451 2873 E ActivityTrigger: activityResumeTrigger: not whiteListed\<my app id\>/com.ansca.corona.CoronaActivity/23 10-15 21:57:45.263 1451 2152 E ActivityTrigger: activityResumeTrigger: not whiteListed\<my app id\>/com.ansca.corona.CoronaActivity/23 10-15 21:57:45.305 7376 7376 W SoundPool: Use of stream types is deprecated for operations other than volume control 10-15 21:57:45.305 7376 7376 W SoundPool: See the documentation of SoundPool() for what to use instead with android.media.AudioAttributes to qualify your playback use case 10-15 21:57:45.579 1451 1559 E ANDR-PERF-JNI: com\_qualcomm\_qtiperformance\_native\_perf\_io\_prefetch\_start 10-15 21:57:45.582 7376 7600 W libOpenSLES: class OutputMix interface 0 requested but unavailable MPH=43 10-15 21:57:45.586 7376 7600 V Corona : \> Class.forName: network.LuaLoader 10-15 21:57:45.586 7376 7600 V Corona : \< Class.forName: network.LuaLoader 10-15 21:57:45.586 7376 7600 V Corona : Loading via reflection: network.LuaLoader 10-15 21:57:45.588 7376 7600 I Corona : Platform: Mi A1 / ARM Neon / 8.1.0 / Adreno (TM) 506 / OpenGL ES 3.2 V@269.0 (GIT@624c5bb, I109c45a694) (Date:05/22/18) / 2018.3326 / English | US | en\_US | en 10-15 21:57:45.592 7376 7600 V Corona : \> Class.forName: \_Corona\_Build\_Number.LuaLoader 10-15 21:57:45.597 7376 7600 W libc : pthread\_create sched\_setscheduler call failed: Operation not permitted 10-15 21:57:45.598 566 6064 E msm8916\_platform: platform\_check\_backends\_match: Invalid snd\_device = 10-15 21:57:45.598 7376 7600 V Corona : \> Class.forName: shared.google.play.services.base.LuaLoader 10-15 21:57:45.598 566 6064 E msm8916\_platform: platform\_check\_backends\_match: Invalid snd\_device = 10-15 21:57:45.598 7376 7600 V Corona : \< Class.forName: shared.google.play.services.base.LuaLoader 10-15 21:57:45.598 566 6064 E audio\_hw\_primary: start\_dsm\_feedback\_process: pcm device id 43 10-15 21:57:45.598 7376 7600 V Corona : Loading via reflection: shared.google.play.services.base.LuaLoader 10-15 21:57:45.603 7376 7600 V Corona : \> Class.forName: \_CoronaSetup.LuaLoader 10-15 21:57:45.612 7376 7600 V Corona : \> Class.forName: CoronaProvider.licensing.google.LuaLoader 10-15 21:57:45.612 7376 7600 V Corona : \< Class.forName: CoronaProvider.licensing.google.LuaLoader 10-15 21:57:45.612 7376 7600 V Corona : Loading via reflection: CoronaProvider.licensing.google.LuaLoader 10-15 21:57:45.633 7376 7600 V Corona : \> Class.forName: plugin.admob.LuaLoader 10-15 21:57:45.633 7376 7600 V Corona : \< Class.forName: plugin.admob.LuaLoader 10-15 21:57:45.633 7376 7600 V Corona : Loading via reflection: plugin.admob.LuaLoader 10-15 21:57:45.635 7376 7600 V Corona : \> Class.forName: plugin.gpgs.v2.LuaLoader 10-15 21:57:45.635 7376 7600 V Corona : \< Class.forName: plugin.gpgs.v2.LuaLoader 10-15 21:57:45.635 7376 7600 V Corona : Loading via reflection: plugin.gpgs.v2.LuaLoader 10-15 21:57:45.638 7376 7600 V Corona : \> Class.forName: plugin.google.iap.v3.LuaLoader 10-15 21:57:45.638 7376 7600 V Corona : \< Class.forName: plugin.google.iap.v3.LuaLoader 10-15 21:57:45.639 7376 7600 V Corona : Loading via reflection: plugin.google.iap.v3.LuaLoader 10-15 21:57:45.640 7376 7600 I Corona : WARNING: licensing.init() was already called for google. 10-15 21:57:45.826 2981 2981 W SearchServiceCore: Abort, client detached. 10-15 21:57:45.919 7544 7582 E bt\_btif : bta\_jv\_disable 10-15 21:57:45.919 7544 7585 W bt\_osi\_thread: run\_thread: thread id 7585, thread name btif\_sock exited 10-15 21:57:45.919 7544 7582 W bt\_btif : bta\_dm\_disable BTA\_DISABLE\_DELAY set to 200 ms 10-15 21:57:46.119 567 567 W vendor.qti.bluetooth@1.0-bluetooth\_hci: BluetoothHci::close() 10-15 21:57:46.191 567 7580 W vendor.qti.bluetooth@1.0-data\_handler: OnPacketReady: Received event for command sent internally: 03 0c 10-15 21:57:46.191 567 567 W vendor.qti.bluetooth@1.0-data\_handler: DataHandler::CleanUp() 10-15 21:57:46.191 567 567 W vendor.qti.bluetooth@1.0-async\_fd\_watcher: StopThread: stopped the work thread 10-15 21:57:46.282 567 567 W vendor.qti.bluetooth@1.0-data\_handler: controller Cleanup done 10-15 21:57:46.282 567 567 W vendor.qti.bluetooth@1.0-bluetooth\_hci: BluetoothHci::close, finish cleanup 10-15 21:57:46.283 7544 7576 W bt\_osi\_thread: run\_thread: thread id 7576, thread name hci\_thread exited 10-15 21:57:46.284 7544 7581 W bt\_osi\_thread: run\_thread: thread id 7581, thread name bt\_workqueue exited 10-15 21:57:46.288 7544 7544 W BluetoothAdapterService: onProfileServiceStateChange() serviceName=com.android.bluetooth.gatt.GattService, state=10, doUpdate=true 10-15 21:57:46.290 7544 7544 W BluetoothAdapterService: onUnbind, calling cleanup 10-15 21:57:46.292 7544 7544 W BluetoothSdpJni: Cleaning up Bluetooth SDP Interface... 10-15 21:57:46.292 7544 7544 W BluetoothSdpJni: Cleaning up Bluetooth SDP object 10-15 21:57:46.292 7544 7561 E BluetoothServiceJni: Callback: 'callback\_thread\_event' is not called on the correct thread 10-15 21:57:46.293 7544 7566 W bt\_osi\_thread: run\_thread: thread id 7566, thread name bt\_jni\_workqueue exited 10-15 21:57:46.306 7544 7565 W bt\_osi\_thread: run\_thread: thread id 7565, thread name alarm\_dispatcher exited 10-15 21:57:46.306 7544 7564 W bt\_osi\_thread: run\_thread: thread id 7564, thread name alarm\_default\_ca exited 10-15 21:57:46.307 7544 7544 W BluetoothVendorJni: Cleaning up Bluetooth Vendor Interface... 10-15 21:57:46.307 7544 7544 W BluetoothVendorJni: Cleaning up Bluetooth Vendor callback object 10-15 21:57:46.323 1451 1540 W zygote64: kill(-7544, 9) failed: No such process 10-15 21:57:46.786 7376 7600 W plugin.gpgs.v2: Not connected 10-15 21:57:46.967 7376 7600 I Corona : Trying to verify license... 10-15 21:57:46.967 7376 7600 I Corona : verified license
Hi Rob, I also tried rebuildIng it but still have the same problem
No difference for me as well.
Please dont run: ‘adb logcat Corona:v *:w’
this filters messages to only those that come from your Corona activity (i.e. print() statements, and Corona crashes), Google Play is a different activity and if you run that command you won’t get messages from Google play.
You have to just do:
‘adb logcat’
and manually filter through all the noise looking for errors.
Please do not post “It doesn’t work”. Help us help you. Please provide this critical debugging information. If your logcat post is going to be more than a few lines, please use a service like pastebin.com and post the link here to help keep the forum threads readable.
Thanks
Rob
I had a regular ‘adb logcat’ but it didn’t show anything useful at first look. But I’ll try to post that after I get home.
And I agree with you about the “it doesn’t work”, but really, that’s all I can say when I couldn’t find any other debug info in my logcat. I have been trying to help.
I have built with 2018.3408
The login functionality is working,but now the achievements, leaderboards and snapshots are not working. even after log in. The default windows are not showing up for them.
Code for achievements and leaderboards funcitonality:
local function handleButton(event) if (event.target.id == "inGameLeaderboards" and event.phase == "ended") then if (gpgs.isConnected()) then gpgs.leaderboards.show() else gpgs.login( { userInitiated = true, listener = gpgsLoginListener } ) gpgs.leaderboards.show() end -- gpgs is connected check outer END elseif (event.target.id == "inGameAchievements" and event.phase == "ended") then if (gpgs.isConnected()) then gpgs.achievements.show() else gpgs.login( { userInitiated = true, listener = gpgsLoginListener } ) gpgs.achievements.show() end -- gpgs is connected check outer END end -- button conditional END end
Code for snapshots upload and download funcitonality:
local function handleButton (event) if (event.target.id == "cloudUpload" and event.phase == "ended") then -- save snapshots local function gpgsSnapshotOpenForSaveListener( event ) if not event.isError then local snapContent = gpgs.snapshots.getSnapshot(event.snapshotId).contents snapContent.write( json.encode(gameData) ) -- Write new gameData as a JSON string into the snapshot gpgs.snapshots.save({ snapshotId = event.snapshotId, description = "Game scores", image = { filename = "EmojiCrushShare.png", baseDir = system.ResourceDirectory }, }) end end -- gpgsSnapshotOpenForSaveListener func END if (gpgs.isConnected()) then gpgs.snapshots.open({ -- Open the save slot filename = snapshotFileName, create = true, -- Create the snapshot if it's not found conflictPolicy = "most recently modified", listener = gpgsSnapshotOpenForSaveListener }) gpgs.snapshots.load( {reload = true, }) gpgs.snapshots.show( {title = "Emoji Crush", disableAdd = false, disableDelete = false}) else gpgs.login( { userInitiated = true, listener = gpgsLoginListener } ) gpgs.snapshots.open({ -- Open the save slot filename = snapshotFileName, create = true, -- Create the snapshot if it's not found conflictPolicy = "most recently modified", listener = gpgsSnapshotOpenForSaveListener }) gpgs.snapshots.load( {reload = true, }) gpgs.snapshots.show( {title = "Emoji Crush", disableAdd = false, disableDelete = false}) end -- gpgs is connected check outer END elseif (event.target.id == "cloudDownload" and event.phase == "ended") then -- download snapshot local function gpgsSnapshotOpenForReadListener( event ) if not event.isError then local retrievedData = gpgs.snapshots.getSnapshot (event.snapshotId) local gameData, pos, msg = json.decode( retrievedData ) if not gameData then toast.show('Decoding failed.' ..tostring(pos)..": "..tostring(msg)) else loadsave.saveTable( gameData, "gameData.json" ) end else -- DO NOTHING end -- event.iserror conditional END end --gpgsSnapshotOpenForReadListener func END if (gpgs.isConnected()) then gpgs.snapshots.open({ filename = snapshotFileName, conflictPolicy = "most recently modified", listener = gpgsSnapshotOpenForReadListener }) gpgs.snapshots.load( {reload = true, }) gpgs.snapshots.show( {title = "Emoji Crush", disableAdd = false, disableDelete = false}) else gpgs.login( { userInitiated = true, listener = gpgsLoginListener } ) gpgs.snapshots.open({ filename = snapshotFileName, conflictPolicy = "most recently modified", listener = gpgsSnapshotOpenForReadListener }) gpgs.snapshots.load( {reload = true, }) gpgs.snapshots.show( {title = "Emoji Crush", disableAdd = false, disableDelete = false}) end -- gpgs.isconnected END end-- conditional END
log with adb logcat:
This is the log when I click leaderboards.show()
10-17 20:30:56.487 23217 23945 W plugin.gpgs.v2: Not connected 10-17 20:30:56.580 844 1088 D PerfServiceManager: [PerfService] MESSAGE\_TIMEOUT:106 10-17 20:30:56.581 844 1088 I libPerfService: 6: set: 1 10-17 20:30:56.581 844 1088 I libPerfService: 6: set freq: 0 10-17 20:30:56.613 844 1049 D InputReader: AP\_PROF:AppLaunch\_dispatchPtr:Down:19806627, ID:0, Index:-1947215912 10-17 20:30:56.613 844 1049 I PerfService: PerfServiceNative\_boostEnableAsync:6 10-17 20:30:56.614 844 1088 I libPerfService: 6: set freq: 819000 10-17 20:30:56.614 844 1088 I libPerfService: 6: set: 3 10-17 20:30:56.673 844 1049 D InputReader: AP\_PROF:AppLaunch\_dispatchPtr:Up:19806688, ID:0, Index:-1947212520 10-17 20:30:56.673 844 1049 I PerfService: PerfServiceNative\_boostEnableTimeoutMsAsync:6, 100 10-17 20:30:56.684 23217 23945 W plugin.gpgs.v2: Not connected
When I press achievements.show()
10-17 20:38:39.369 23217 24153 W plugin.gpgs.v2: Not connected 10-17 20:38:39.443 1638 1650 E GED : Failed to execute ioctl 3222824709, BridgeID(5), err(-1) 10-17 20:38:39.443 1638 1650 E GasService: Error on query GED info, err=1 10-17 20:38:39.457 844 1088 D PerfServiceManager: [PerfService] MESSAGE\_TIMEOUT:106 10-17 20:38:39.457 844 1088 I libPerfService: 6: set: 1 10-17 20:38:39.458 844 1088 I libPerfService: 6: set freq: 0 10-17 20:38:39.566 1139 1543 D NetworkController.MobileSignalController(1): onSignalStrengthsChanged signalStrength=SignalStrength: 11 27 -120 -160 -120 -1 -1 99 2147483647 2147483647 2147483647 2147483647 2147483647 gsm|lte 2147483647 -376 10 level=3 10-17 20:38:39.566 1139 1543 D NetworkController.MobileSignalController(1): updateTelephonySignalStrength: hasService=true ss=SignalStrength: 11 27 -120 -160 -120 -1 -1 99 2147483647 2147483647 2147483647 2147483647 2147483647 gsm|lte 2147483647 -376 10 10-17 20:38:39.578 844 8340 V ActivityManager: Broadcast sticky: Intent { act=android.intent.action.SIG\_STR flg=0x20000010 (has extras) } ordered=false userid=-1 callerApp=ProcessRecord{3d0fc53 844:system/1000} 10-17 20:38:39.582 1139 1543 D NetworkController.MobileSignalController(1): isWifiCallingAvailable=false 10-17 20:38:39.587 1139 1543 V ReflectionMethods: ========ReflectionMethods.getVolteAvailable = false =============== 10-17 20:38:39.591 1139 1543 V ReflectionMethods: ========ReflectionMethods.getVideoTelephonyAvailable = false =============== 10-17 20:38:39.719 259 259 I DisplayDevice: [Built-in Screen (type:0)] fps:59.872215,dur:1002.13,max:28.51,min:12.91 10-17 20:38:39.936 259 1438 I BufferQueueProducer: [SurfaceView - com.sheekore.games.sentioTapEmoji/com.ansca.corona.CoronaActivity](this:0x731244f000,id:845,api:1,p:23217,c:259) queueBuffer: fps=60.89 dur=1001.79 max=32.49 min=8.78 10-17 20:38:40.267 252 252 I wmt\_launcher: fw log ctrl flag has been set 10-17 20:38:40.267 252 252 I wmt\_launcher: fw dynamic ctrl flag has been set 10-17 20:38:40.410 23817 24091 I EventLogSendingHelper: Sending log events. 10-17 20:38:40.444 1638 1650 E GED : Failed to execute ioctl 3222824709, BridgeID(5), err(-1) 10-17 20:38:40.444 1638 1650 E GasService: Error on query GED info, err=1 10-17 20:38:40.449 371 371 I thermal\_repeater: select timeout 10-17 20:38:40.533 1481 1481 V ActivityThread: SVC-Destroying service com.google.android.gms.lockbox.service.LockboxBrokerService@ff634bd 10-17 20:38:40.537 1481 1481 V ActivityThread: SVC-Destroying service com.google.android.location.reporting.service.ReportingAndroidService@7143ab2 10-17 20:38:40.722 259 259 I DisplayDevice: [Built-in Screen (type:0)] fps:60.836521,dur:1002.69,max:20.98,min:12.34 10-17 20:38:40.946 259 282 I BufferQueueProducer: [SurfaceView - com.sheekore.games.sentioTapEmoji/com.ansca.corona.CoronaActivity](this:0x731244f000,id:845,api:1,p:23217,c:259) queueBuffer: fps=61.35 dur=1010.60 max=22.38 min=8.95 10-17 20:38:41.038 844 1049 D InputReader: AP\_PROF:AppLaunch\_dispatchPtr:Down:20271052, ID:0, Index:-1947215912 10-17 20:38:41.038 844 1049 I PerfService: PerfServiceNative\_boostEnableAsync:6 10-17 20:38:41.039 844 1088 I libPerfService: 6: set freq: 819000 10-17 20:38:41.040 844 1048 D PowerManagerNotifier: onUserActivity: event=2, uid=1000 10-17 20:38:41.042 844 1088 I libPerfService: 6: set: 3 10-17 20:38:41.112 1638 1649 E GED : Failed to execute ioctl 3222824709, BridgeID(5), err(-1) 10-17 20:38:41.112 259 1438 I SurfaceFlinger: Adjust vsync offset: old[0] new[0] 10-17 20:38:41.118 844 1049 D InputReader: AP\_PROF:AppLaunch\_dispatchPtr:Up:20271133, ID:0, Index:-1947212520 10-17 20:38:41.119 844 1049 I PerfService: PerfServiceNative\_boostEnableTimeoutMsAsync:6, 100 10-17 20:38:41.132 23217 24153 W plugin.gpgs.v2: Not connected
with snapshot the logcat also shows
10-17 20:43:57.091 23217 24469 W plugin.gpgs.v2: Not connected
The above codes works fine in gpgs V1. I have updated the snapshot code for v2, which requires snapshotId instead of snapshot when saving snapshots.
Same for me, initialization and logging in works fine, but any other functions doesn’t work at all.
Can everyone give it another try. We think we’ve addressed this issue.
Rob
Thank you and the dev team for the quick fixes.
For me the snapshot window, leaderboards window and achievements window works.
I have noticed a pecularity in login.
When I try to login I get the usual pop up screen and I select the account through which I want to login and after a few seconds of the circling loading icon login does not work - that is sign in is not successful. Then when I tap the login button again, without any pop up I get successfully logged in the same account. I have tried this three times and got the same result.
If you could please look into the login issue.
We are looking into it, but I don’t think the rest of the plugin would be working if logging in wasn’t working.
Rob
It’s working for me now.
However, the app now asks the user for permission to use his email address. Is there a way to avoid that or is it required by GPGS?
Best regards!
Yes, the login works. What I meant was that it takes two attempt to successfully login. At the first attempt the usual process occurs - pop up to which account to login with, then the loading icon appears after that login is not successful. In the second attempt of clicking the login button, then I have successful login without any prompt. I tried it few times and saw it always takes two attempts to have successful login.