Skip to content Skip to sidebar Skip to footer

Google Plus Android Api: "the Method Setactions(string[]) Is Undefined For The Type Plusclient.builder"

I am trying to make the sample Android Google+ app working... (sample app provided by Google here: https://developers.google.com/+/quickstart/android ) I am getting a compiling err

Solution 1:

1) Go to SDK Manager and go to extras and select google play services and install latest update.

2) Then browse through your sdk folder like sdk/extras/google/.. You will find the library project.Import that project into workspace and add it as library to ur project.

3) Then clean build and run.

Solution 2:

"The method setActions(String[]) is undefined for the type PlusClient.Builder"

means you are passing String array to setActions method but as in API Doc setActions (String... actions) method takes String as action parameters instead of String Array

because setActions method takes variable arguments(Varargs) so you can pass multiple sting in setActions method without using array as:

mPlusClient = new PlusClient.Builder(this, this, this)
                .setActions(MomentUtil.ACTIONS[0],
                            MomentUtil.ACTIONS[1],....) 
                .build();

Solution 3:

They changed the method name from setActivities to setActions.

http://developer.android.com/reference/com/google/android/gms/plus/PlusClient.Builder.html

Post a Comment for "Google Plus Android Api: "the Method Setactions(string[]) Is Undefined For The Type Plusclient.builder""