12

I have an Android Wear app which was working fine on my Moto360. It access Google Play Services and GCM APIs in the Google Admin console. Then I tried to use another watch (LG G Watch). Because I can only pair one watch at any time with my phone, I had to "forget" the moto360 in order to pair with the LG G Watch. Now I cannot seem to connect to Google App API (GCM or play services). I am getting the following error:

I/GMPM    ( 2746): App measurement is starting up
E/GMPM    ( 2746): getGoogleAppId failed with status: 10
E/GMPM    ( 2746): Uploading is not possible. App measurement disabled

This error occurs in the logcat of both the watch and the accompanying mobile app. I tried looking up what the status code but could not find any info. Could anyone please help in gleaning what this status code mean?

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
VarsMolta
  • 432
  • 2
  • 5
  • 13
  • You can try to not only forget your moto 360 on your phone but also reset your new Lg g watch. – bjiang Sep 28 '15 at 17:52
  • I did factory reset the LG G watch and it gave me the same error. Whats strange is that I went back to Moto360 (including doing a factory reset) and it gave me the error again. Then I manually installed a version of my apk that used to work and that does not give me an error. So its not a permissions issue on the Google API console backend. It seems like a Android Studio configuration problem local to my machine perhaps? – VarsMolta Sep 29 '15 at 20:01
  • I had the same issue. for me it actually was just that even though I set up the `GoogleApiClient` I never called `.connect()` on it. Worked fine after that. – Mathias Oct 07 '15 at 20:24

3 Answers3

2

Replace addApi with addApiIfAvailable

mGoogleApiClient = new GoogleApiClient.Builder(this)                     
                    .addApiIfAvailable(Drive.API)
                    .addScope(Drive.SCOPE_FILE)
                    .addConnectionCallbacks(this)
                    .addOnConnectionFailedListener(this)
                    .build();
GreenROBO
  • 4,725
  • 4
  • 23
  • 43
Ashish Patel
  • 59
  • 1
  • 9
  • I manually installed a version of my apk that used to work and that does not give me an error. So its not a permissions issue on the Google API console backend – VarsMolta Sep 29 '15 at 20:01
  • also, the onConnectionFailed callback is not being called...so yet another indicator that its not something with wrong with authorization – VarsMolta Sep 29 '15 at 20:03
0

I was with same error, it was resolved with in the instantiation of Client doing:

            GoogleApiClient  mGoogleClient = new GoogleApiClient.Builder(this)
            .addApi(Wearable.API)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();

And be sure of override this classes:

@Override
    protected void onStart(){
        super.onStart();
        if (!mResolvingError) {  // more about this later
            mGoogleClient.connect();
        }
    }

    @Override
    protected void onStop(){
        mGoogleClient.disconnect();
        super.onStop();
    }

    @Override
    public void onConnected(Bundle bundle) {
        Log.d(TAG, "Connected");
    }

    @Override
    public void onConnectionSuspended(int i) {

    }

    @Override
    public void onConnectionFailed(ConnectionResult connectionResult) {
        Log.d(TAG, "Failed to connect");
    }

I used Log.d to test the connection.

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
7xRobin
  • 341
  • 1
  • 4
  • 11
0

I had the same problem with google's geofencing example. It was caused by location and wearable API version mismatch as you can see below.

dependencies {
    compile "com.android.support:support-v4:23.0.0"
    compile "com.android.support:support-v13:23.0.0"
    compile "com.android.support:cardview-v7:23.0.0"
    compile 'com.google.android.gms:play-services-location:7.3.0'
    compile 'com.google.android.gms:play-services-wearable:7.8.0'
    compile 'com.android.support:support-v13:23.0.1'
    wearApp project(':Wearable')
}

Verify your build.grade to check version of API in use.

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
Patrice Conil
  • 83
  • 1
  • 8