It’s been a while since I built any Android code using Elements / Oxygene involving Google Api Client and things seem to have changed quite a bit from what I remember.
There now appears to be a reliance on Gradle build tools/services and whilst Elements / Oxygene supports dependencies via Gradle quite nicely, other aspects (as far as I know) are not supported. So, for example, all the guides that describe building a google-services.json and then adding an “apply plugin” to the app gradle, whilst adding a classpath to the project gradle don’t appear to translate to Elements / Oxygene.
I have been unable to find any references to what these build tools do. i.e. how to reproduce manually what these tools do for me automatically. As a result I cannot get even a simple Android app with Google Sign In to run.
It builds fine but as soon as I try to “build()” my Google Api Client the app crashes and in typically modern fashion there appear to be no error messages or other feedback to tell me what’s gone wrong (or what I’ve done wrong/missed/left out/etc).
i.e. if I comment out this line of code:
mGoogleApiClient := new GoogleApiClient.Builder(self)
.enableAutoManage(self, self)
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.build;
Then my app “runs” fine. In that the activity presents in the UI. It does nothing of course since the sole purpose of the app is to exercise a bare bones sign-in and this code is essential to that.
If I leave this line of code uncommented, the app start perfectly fine but terminates (exit code 0 - thanks a bunch Google). I did have a message in the logcat telling me that I was missing a google_app_id string, which I have now added, and so no longer get this message but this made no difference to the terminating behaviour.
Does anybody have a working example of implementing Google Sign In for an Android app using Elements ?