Extension-googleplaygames

Should I specify this meta on top of the one that comes with the project?
Or will this do?

<meta title=“Test” package=“com.antehero.something.Test” version=“1.0.0” company=“Author” />

Ah, you’re testing with extension-googleplaygames. I can do that too, but first, can you test without? I want to make sure we’re on the same page.

Yep, compiles fine without extension-googleplaygames

Ok, I’m still not done, but here are some notes on my progress.

  • I see the same error when including extension-googleplaygames.
  • I can compile Google’s sample app without problems.
  • Both the sample app and extension-googleplaygames include support-v4, and the sample app includes appcompat-v7 as well.
  • Adding the support libraries doesn’t fix the problem.
  • The value of google_play_services_version is defined in the “play-services-basement” project.
  • Importing any other Play Services project imports play-services-games.
  • If you check deps/google-play-services/build/intermediates/res/merged/release/values/values.xml, you’ll find that it includes google_play_services_version.
  • The same is not true of deps/gpgex/build/.../values.xml.

I’ll look into that tomorrow.

Any progress on this?

I didn’t have much time for this today, but when you brought it up, I figured I’d try the simplest solution that might possibly work.

And it worked!

The answer was to have extension-googleplaygames depend on my library. Here’s my version. If you’re comfortable messing with Git, set my fork as a remote and pull the gradle branch. If not:

> haxelib remove extension-googleplaygames
> haxelib git extension-googleplaygames https://github.com/player-03/extension-googleplaygames.git

Well this is odd.
I’m getting:

C:/Users/android/extension-googleplaygames/git/extension/gpg/GooglePlayGames.hx:245: characters 5-24 : Unknown identifier : onLoadPlayerPicture
C:/Users/android/extension-googleplaygames/git/extension/gpg/GooglePlayGames.hx:245: characters 32-51 : Unknown identifier : onLoadPlayerPicture

The first time I tried it I got this:
error: package com.google.android.gms.plus does not exist
So I tried putting in a gradle template, got the error above, then removed it.
Now it’s the only error I’m getting

K, I went into GooglePlayGames.hx and changed public static var onLoadPlayerPicture to onLoadPlayerImage.

Now I’m back to this:

C:\Users\Desktop\Zephyr\bin\android\release\bin\deps\gpgex\src\main\java\com\gpgex\GameHelper.java:39: error: package com.google.android.gms.plus does not exist
import com.google.android.gms.plus.Plus;
^
C:\Users\Desktop\Zephyr\bin\android\release\bin\deps\gpgex\src\main\java\com\gpgex\GameHelper.java:246: error: cannot find symbol
builder.addApi(Plus.API);
^
symbol: variable Plus
location: class GameHelper
C:\Users\Desktop\Zephyr\bin\android\release\bin\deps\gpgex\src\main\java\com\gpgex\GameHelper.java:247: error: cannot find symbol
builder.addScope(Plus.SCOPE_PLUS_LOGIN);
^
symbol: variable Plus
location: class GameHelper
C:\Users\Desktop\Zephyr\bin\android\release\bin\deps\gpgex\src\main\java\com\gpgex\GameHelper.java:462: error: package Plus does not exist
Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
^
:deps:gpgex:compileReleaseJavaWithJavac FAILED
Note: C:\Users\Desktop\Zephyr\bin\android\release\bin\deps\gpgex\src\main\java\com\gpgex\GameHelper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors

Ok it looks like googlePlus is a pre-requisite for googlePlayGameServices.
Added this line and got it to compile:

set name=“googlePlus” if=“android” />

However, that’s with the changes I made to GooglePlayGames.hx which I don’t think are correct.
That class seems to be referencing a variable that’s not declared at line 245.
Did you have any problems with that?

No, your fix looks good. The problem was that I didn’t import the GooglePlayGames class in my tests, so Haxe didn’t notify me of that error.

Oh yeah, I forgot to mention that. Sorry!

Are your sure? I think someone would have noticed that, it’s like the first error that comes up.

I’ve got it signing in to googlePlayGames services and failing to login.
Not sure what the problem is, think i’ll just tinker around till I figure it out.
Have you used that lib successfully before?

I’ve never actually used it. I usually do my own integrations.

Actually it might be permissions.
Can you set those in the project.xml or do I need to override the manifest?
Also, what permissions do you think I need for google play services?
Can’t find much about it on google

You can add permissions like this:

<android permission="android.permission.WAKE_LOCK" />
<android permission="android.permission.INTERNET" />
<android permission="android.permission.VIBRATE" />
<android permission="android.permission.ACCESS_NETWORK_STATE" />

These ones are included by default, but be careful: defining your own will remove the defaults, so you’ll want to add android.permission.INTERNET manually.

I can’t think of any besides INTERNET that you should need. Here’s the full list so that you can try some others, but I think a better solution would be to check the log.

OpenFL filters the log, almost certainly filtering out messages from the Google Play Game Services. You have to use adb logcat to see the whole thing.

Logcat gives you a huge amount of text, so make sure you press ctrl+C to cut it off right after you trigger the error. Then you know where to look. (You can also use adb locat -c to clear out all the old text before you start.)

"Unable to login, application does not have a registered client ID."
Just figured out how the OAuth client ID fingerprint thing works.
Is that supposed to go in at GOOGLE_PLAY_GAMES_ID or somewhere else?

I have a lot of bullshit messages coming out of logcat, it’s like that on Android studio as well.
Is that because of other apps that aren’t made well?
Is there a way to figure out which ones I should uninstall to stop that from happening?

That’s just how it is on Android. There’s a lot going on behind the scenes, and the developers figure those messages might be important to someone, so they left them in. This is why it’s so important to have a strategy like “cut off the log immediately after the error” or “filter based on pre-determined keywords.”

Filtering is nicer in theory, except when you get a false negative. For instance, filtering by “Google” should give you almost everything related to the Google Play Services, but what if there’s an important line that happens not to contain “Google”?

You’re supposed to paste the fingerprint into the developer console; it’s then used to generate the client ID. This client ID contains the application ID, a.k.a. GOOGLE_PLAY_GAMES_ID. Actually, you’re supposed to do this twice: once for each of your certificates (debug and release).

Go through this list and double-check that you did everything right. We already dealt with #4, and #6 isn’t relevant yet, but check the others.

I’m getting this error a lot as well:
AppOps : Bad call: specified package com.googl
e.android.gms under uid 10187 but it is really 10017

K, i think I got it working now, just updated the client ID using the API manager and set GooglePlayGames.init( true ) to GooglePlayGames.init( false ), I think you need the google drive API enabled to set that one as true.
Thanks for all your help, I think I can figure it out from here!