Error implementing GoogleApiClient Builder for Android development

后端 未结 5 614
走了就别回头了
走了就别回头了 2020-12-05 07:06

I am following Google\'s documentation to implement Google+ Sign In feature into an app.

https://developers.google.com/+/mobile/android/getting-started

I fol

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 07:12

    I see in their documentation where they clearly instruct you to include this import:

    import com.google.android.gms.common.GooglePlayServicesClient.ConnectionCallbacks;
    

    However, the error being thrown is expecting a different class than GooglePlayServicesClient.ConnectionCallbacks, it's asking for GoogleApiClient.ConnectionCallbacks. Try changing your implements to use the more-qualified class name. That looks to be the only possible thing throwing the code for a loop and without the explicit qualified classname, it will default to the directly imported class name.

    It's always tougher when you have to question the manual.

    Edit: I mean a change like this:

    public class MainActivity 
        extends ActionBarActivity 
        implements GoogleApiClient.ConnectionCallbacks,
                   GoogleApiClient.OnConnectionFailedListener {
    

提交回复
热议问题