I'm trying to setup a Google Wear app, so on my mobile side, I'm trying to create a GoogleApiClient that uses the Wearable API, but I get an error saying I need to update (SERVICE_VERSION_UPDATE_REQUIRED). But my phone is already at the latest version of Google Play Services. I used the standard Android Studio create wizard to create an app with a wear app, and this is my main activity (and I also added "" to the Manifest.
import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.util.Log;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.wearable.Wearable;
public class MyActivity extends Activity
implements
GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener {
private GoogleApiClient mGoogleApiClient;
private String TAG = "MyApp";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Wearable.API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
}
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
@Override //ConnectionCallbacks
public void onConnected(Bundle connectionHint) {
Log.d(TAG, "Google API Client was connected");
}
@Override //ConnectionCallbacks
public void onConnectionSuspended(int cause) {
Log.d(TAG, "Connection to Google API client was suspended");
}
@Override //OnConnectionFailedListener
public void onConnectionFailed(ConnectionResult result) {
Log.d(TAG, "FAILED TO CONNECT");
Dialog d = GooglePlayServicesUtil.getErrorDialog(result.getErrorCode(), this, 0);
d.show();
}
}