fit-samples icon indicating copy to clipboard operation
fit-samples copied to clipboard

Google Fit API: ApiException 17 (Fitness.CLIENT is not available on this device)

Open codingjeremy opened this issue 5 years ago • 5 comments

Issue by hrsalehi Friday May 04, 2018 at 03:07 GMT Originally opened as https://github.com/googlesamples/android-fit/issues/34


I configured Google fit api and followed "Getting Started" section of google docs. But when I trying to read "Steps" data I face "Google Fit API: ApiException 17 (Fitness.CLIENT is not available on this device)" exception in Task object callback from getRecordingClient

        Fitness.getRecordingClient(context, GoogleSignIn.getLastSignedInAccount(context))
                .subscribe(DataType.TYPE_STEP_COUNT_CUMULATIVE)
                .addOnCompleteListener(
                        new OnCompleteListener<Void>() {
                            @Override
                            public void onComplete(@NonNull Task<Void> task) {
                                if (task.isSuccessful()) {
                                    Log.i(LOG_TAG, "Successfully subscribed!");
                                } else {
                                    Log.w(LOG_TAG, "There was a problem subscribing.", task.getException());
                                }
                            }
                        });

codingjeremy avatar Sep 10 '19 20:09 codingjeremy

Hey, I have lot of user with the same issue. Did you found a fix?

bunjix avatar Nov 27 '19 15:11 bunjix

I'm facing this issue as well. Any resolution?

sagrgpt avatar Aug 05 '20 12:08 sagrgpt

i was facing same issue and no refrence was available but according to : public static final int API_NOT_CONNECTED The client attempted to call a method from an API that failed to connect. Possible reasons include:

The API previously failed to connect with a resolvable error, but the user declined the resolution.
The device does not support GmsCore.
The specific API cannot connect on this device.
Constant Value: 17

from google docs , for a reason api is not available in device..

I am from Iran ! this service is restricted by google to Iranian users ! this was the reason finally ! when i using VPN for google auth the problem is resolve !

mr-mamali avatar Aug 18 '20 08:08 mr-mamali

@mr-mamali I have received this issue for a user from Iran as well. The exception now makes sense. Thanks for your reply.

sagrgpt avatar Aug 19 '20 08:08 sagrgpt

I am getting this error; I live in India, can someone help me

Deveshgsk avatar Jul 19 '21 07:07 Deveshgsk