Question

I am attempting to add Google Plus support to an Air mobile app by creating a native extension. The code works in a standalone project however attempting to use it as a native extension produces the following error:

Failed resolving Lcom/myname/ane/sharingextensions/googleplus/GooglePlusConnect; interface 479 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
04-08 15:51:29.573: W/dalvikvm(19956): Link of class 'Lcom/myname/ane/sharingextensions/googleplus/GooglePlusConnect;' failed

It seems to me that the Google Play Services library is not actually being included in the native extension. The google-play-services_lib project is added as a library project to my native extension project. I have tried extracting the bin/google-play-services_lib.jar file from the google-play-services_lib project and updating my native extension jar with the contents

jar xf /path-to-play-services-project/bin/google-play-services_lib.jar
jar uf ./my_gplus_extension.jar ./android

but this does not seem to fix the problem (all that seems to be in there is a single "UnusedStub.class" file). I have also updated the Android SDK in the Adobe Air directory to version 19 (as described here http://lancelotmobile.com/blog/air-compile-for-android-4/) but this also has had no effect. The offending class is:

public class GooglePlusConnect extends FragmentActivity implements
    ConnectionCallbacks, OnConnectionFailedListener,
    ResultCallback<People.LoadPeopleResult> {

        //Pretty much a clone of the google plus sign-in sample project
    }

It would be great if anyone had any insight into this or can spot any daft mistakes I have made.

Was it helpful?

Solution

I think I just answered my own question, seems like I need to be extracting the contents of /path-to-play-services-project/libs/google-play-services.jar which actually contains lots of stuff, and corrects that link error when I update my extension jar file with its contents. The following seems to sort it:

jar xf /path-to-play-services-project/libs/google-play-services.jar
jar uf ./my_gplus_extension.jar ./com
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top