can not find Symbol class Builder

Asked

Viewed 242 times

2

I created a project in Android Studio 1.0, Login Activity.

I did the following: No Build.Radle

compileSdkVersion 21        
buildToolsVersion "21.1.1"  

dependencies {                                                      
compile fileTree(include: ['*.jar'], dir: 'libs')               
compile 'com.android.support:appcompat-v7:21.0.2'               
compile 'com.google.android.gms:play-services:6.5.87'           
compile 'com.google.android.gms:play-services-plus:6.5.+'       
compile 'com.google.android.gms:play-services-identity:6.5.+'   
compile files('libs/google-play-services.jar')                  
compile files('libs/android-support-v4.jar')                    
}                                                                   

I have a class called Loginactivity.java and another Plusbaseactivity.java

The Plusbaseactivity.java class has the following error:

can not find symbol class Builder

Part of the code containing the error:

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Initialize the PlusClient connection.
    // Scopes indicate the information about the user your application will be able to access.
    mPlusClient =
            new PlusClient.Builder(this, this, this).
                    setVisibleActivities("http://schemas.google.com/AddActivity", "http://schemas.google.com/CheckInActivity")
                    .setScopes(Scopes.PLUS_LOGIN,
                    Scopes.PLUS_ME).build();
}

I already searched the internet and I haven’t found the solution, some tip how to solve this problem?

  • Another suggestion is to use the statements of Google Play Services and the Support Library via Gradle, and not with the jar. Use compile 'com.android.support:support-v4:21.0.0', and in the case of play-services is not duplicating?

1 answer

2

I looked into it, found that PlusClient is no longer approved (deprecated), if you still want to use it, use an earlier version of the API, like this:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:21.0.2'
    compile 'com.google.android.gms:play-services:6.1.71'
    compile 'com.android.support:support-v4:21.0.0'
}

I recommend that you look for more information about the Googleapiclient, as it is a unified API that allows integration with Google Play services.

References

can not find Symbol class Builder
New Client API Model in Google Play Services
Setting Up Google Play Services
Accessing Google Apis

  • Who gave the downvote could manifest so that I can improve the answer? And correct if there is any fault in it!

  • I will still test the suggestions. Thanks for the tips to all

Browser other questions tagged

You are not signed in. Login or sign up in order to post.