Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can not find symbol class Builder

I am using loginActivity in android.

ERROR

can not find symbol class Builder

I have also imported the file: com.google.android.gms.plus.PlusClient

Error on this line

mPlusClient = new PlusClient.Builder(this, this, this).setScopes(Scopes.PLUS_LOGIN, Scopes.PLUS_ME).build();

This is auto generated file from template. What could be the reason for this error?

EDIT

I am using android studio

minSdkVersion 11

targetSdkVersion 21

like image 283
Ronak Patel Avatar asked Dec 09 '14 21:12

Ronak Patel


People also ask

How do I fix error Cannot find symbol?

In the above program, "Cannot find symbol" error will occur because “sum” is not declared. In order to solve the error, we need to define “int sum = n1+n2” before using the variable sum.

What does it mean when it says Cannot find symbol?

The cannot find symbol error, also found under the names of symbol not found and cannot resolve symbol , is a Java compile-time error which emerges whenever there is an identifier in the source code which the compiler is unable to work out what it refers to.


2 Answers

I solved in my project by downgrading play-services to:

compile 'com.google.android.gms:play-services:6.1.71'

in dependencies in gradle file.

like image 91
Alessandro Avatar answered Sep 28 '22 08:09

Alessandro


It is not available because it is deprecated. Use GoogleApiClient instead.

Start integrating Google+ : This is the official documentation for implementing Google+ client in your Android app for login and other requirements. Please follow this and not the auto-generated code from Android studio (until the code gets updated with newer implementation).

P.S. The other answer suggests to use older version of PlusClient, which is a wrong approach. You should be using newer code Instead of using older play services.

like image 20
VipulKumar Avatar answered Sep 28 '22 08:09

VipulKumar