Google+ Sign In Button not functioning Android Studio <p>Hi so I am currently integrating a Google Sign In into my app. Lately this has been my only concern that for some reason Android Studio not recognizing the Plus_Login scope (which is necessary for the app to access basic profile info, etc). My current error is this</p> <pre><code>Error:(40, 17) error: method addScope in class Builder cannot be applied to given types; required: Scope found: String reason: actual argument String cannot be converted to Scope by method invocation conversion </code></pre> <p>and here is my onCreate file where the Error is found</p> <p><strong>EDIT 1 - Added import statement and variable declarations</strong></p> <pre><code>package com.instigate.aggregator06; import android.content.Intent; import android.content.IntentSender; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; import com.google.android.gms.common.Scopes; import com.google.android.gms.common.api.Scope; import com.google.android.gms.plus.Plus; public class SocialNetworkActivity extends AppCompatActivity implements ConnectionCallbacks, OnConnectionFailedListener, View.OnClickListener { private static final String TAG = "Social Network Activity"; /* Request code used to invoke sign in user interactions. */ private static final int RC_SIGN_IN = 0; /* Client used to interact with Google APIs. */ private GoogleApiClient mGoogleApiClient; /* A flag indicating that a PendingIntent is in progress and prevents * us from starting further intents. */ private boolean mIntentInProgress; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Plus.API) .addScope(Scopes.PLUS_LOGIN) // &lt;----- This is where the error is found .addScope(Scopes.PLUS_ME) .build(); findViewById(R.id.sign_in_button).setOnClickListener(this); } </code></pre> <p>I have searched a while to find a solution for this error (seeing as the Plus_Login scope should be functioning) yet have found no solution.</p> <p><strong>EDIT 2 - Errors after solving</strong> I found the answer to this. Apparently instead of:</p> <pre><code>.addScope(Scopes.PLUS_LOGIN) .addScope(Scopes.PLUS_ME) </code></pre> <p>we write this</p> <pre><code>.addScope(new Scope(Scopes.PLUS_LOGIN)) .addScope(new Scope(Scopes.PLUS_ME)) </code></pre> <p>which solved my problem.</p> <p>However, it revealed a new problem:</p> <pre><code> findViewById(R.id.sign_in_button).setOnClickListener(this); </code></pre> <p>where logcat points out that there is a NullPointerException at that point.</p> <p><strong>EDIT 3 - Solved NullPointerException</strong> I have solved the NullPointer Exception Problem, however my Google+ Sign In Button will still not function.</p> <p>here is the overall class (continuation of the code snippet mentioned above)</p> <pre><code>package com.instigate.aggregator06; import android.content.Intent; import android.content.IntentSender; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; import com.google.android.gms.common.Scopes; import com.google.android.gms.common.api.Scope; import com.google.android.gms.plus.Plus; public class SocialNetworkActivity extends AppCompatActivity implements ConnectionCallbacks, OnConnectionFailedListener, View.OnClickListener { private static final String TAG = "Social Network Activity"; /* Request code used to invoke sign in user interactions. */ private static final int RC_SIGN_IN = 0; /* Client used to interact with Google APIs. */ private GoogleApiClient mGoogleApiClient; /* A flag indicating that a PendingIntent is in progress and prevents * us from starting further intents. */ private boolean mIntentInProgress; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_social_network); mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Plus.API) //.addScope(Scopes.PLUS_LOGIN) //.addScope(Scopes.PLUS_ME) .addScope(new Scope(Scopes.PLUS_ME)) .addScope(new Scope(Scopes.PLUS_LOGIN)) .build(); this.findViewById(R.id.sign_in_button).setOnClickListener(this); } protected void onStart() { super.onStart(); mGoogleApiClient.connect(); } protected void onStop() { super.onStop(); if (mGoogleApiClient.isConnected()) { mGoogleApiClient.disconnect(); } } /* Code in case second one doesn't work @Override public void onConnectionFailed(ConnectionResult connectionResult) { // Could not connect to Google Play Services. The user needs to select an account, // grant permissions or resolve an error in order to sign in. Refer to the javadoc for // ConnectionResult to see possible error codes. Log.d(TAG, "onConnectionFailed:" + connectionResult); if (!mIsResolving &amp;&amp; mShouldResolve) { if (connectionResult.hasResolution()) { try { connectionResult.startResolutionForResult(this, RC_SIGN_IN); mIsResolving = true; } catch (IntentSender.SendIntentException e) { Log.e(TAG, "Could not resolve ConnectionResult.", e); mIsResolving = false; mGoogleApiClient.connect(); } } else { // Could not resolve the connection result, show the user an // error dialog. showErrorDialog(connectionResult); } } }*/ public void onConnectionFailed(ConnectionResult result) { if (!mIntentInProgress &amp;&amp; result.hasResolution()) { try { mIntentInProgress = true; startIntentSenderForResult(result.getResolution().getIntentSender(), RC_SIGN_IN, null, 0, 0, 0); } catch (IntentSender.SendIntentException e) { // The intent was canceled before it was sent. Return to the default // state and attempt to connect to get an updated ConnectionResult. mIntentInProgress = false; mGoogleApiClient.connect(); } } } public void onConnected(Bundle connectionHint) { // We've resolved any connection errors. mGoogleApiClient can be used to // access Google APIs on behalf of the user. Log.d(TAG, "onConnected:" + connectionHint); Intent j = new Intent(SocialNetworkActivity.this, AccountPageActivity.class); startActivity(j); } protected void onActivityResult(int requestCode, int responseCode, Intent intent) { if (requestCode == RC_SIGN_IN) { mIntentInProgress = false; if (!mGoogleApiClient.isConnecting()) { mGoogleApiClient.connect(); } } } public void onConnectionSuspended(int cause) { mGoogleApiClient.connect(); } @Override public void onClick(View v) { if (v.getId() == R.id.sign_in_button) { //onSignInClicked(); mGoogleApiClient.connect(); } // ... } /* I find this unnecesary private void onSignInClicked() { // User clicked the sign-in button, so begin the sign-in process and automatically // attempt to resolve any errors that occur. //mShouldResolve = true; mGoogleApiClient.connect(); // Show a message to the user that we are signing in. //mStatusTextView.setText(R.string.signing_in); }*/ public void backToMainPage(View view) { Intent j = new Intent(SocialNetworkActivity.this, MainActivity.class); startActivity(j); } } </code></pre> <p>and here is my xml for that class file</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context="com.instigate.aggregator06.SelectSNActivity" android:orientation="vertical" android:id="@+id/SelectSNActivity" android:weightSum="1"&gt; &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/backbtn2" android:id="@+id/backbtntest" android:layout_gravity="right" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_alignParentEnd="true" android:layout_marginBottom="43dp" android:onClick="backToMainPage"/&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:text="@string/selectSocialNetwork" android:id="@+id/selectSocialNetworkHeader" android:textStyle="bold" android:textSize="36sp" android:layout_gravity="center_horizontal" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" /&gt; &lt;com.google.android.gms.common.SignInButton android:id="@+id/sign_in_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/selectSocialNetworkHeader" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_marginTop="52dp" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>Any help is much appreciated, thank you.</p>