9
Awareness.SnapshotApi.getLocation(client)
    .setResultCallback(new ResultCallback<LocationResult>() {
        @Override
        public void onResult(@NonNull LocationResult locationResult) {
            if (locationResult.getStatus().isSuccess()) {

            }

        }
    }).addOnFailureListener(new OnFailureListener() {
        @Override
            public void onFailure(@NonNull Exception e) {
                String error = e.getMessage();
            }

com.google.android.gms.common.api.ApiException: 17: API: ContextManager.API is not available on this device.

I am receiving this error on as an exception for when running the app on a Android 9 essential phone, but no exception when running on Android 8 Samsung s8.

I have updated to the latest 16.0.0 awareness package.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
P t
  • 91
  • 1
  • Not sure what the answer is, but looks like SnapshotAPi.getLocation(client) is deprecated: https://developers.google.com/android/reference/com/google/android/gms/awareness/SnapshotApi – Karl Galvez Jan 21 '19 at 01:54
  • Same here. It will also fail with the usage of the non deprecated function `public static SnapshotClient getSnapshotClient (Context context)` on mostly samsung devices i noticed so far. No fix so far – edhair Mar 04 '19 at 07:40
  • Did you resolve this? I also got this error : "ContextManager.API is not available on this device" – somerandomusername Sep 16 '19 at 13:47

2 Answers2

0

In my case, activating the Awareness API from https://console.developers.google.com for my project resolved this issue.

ildeniz
  • 13
  • 1
  • 5
0

Had the same error while trying to register a fence for the Awareness API. If you are launching your app from AndroidStudio, make sure you registered and use an API key made with your debug.keystore .

My debug.keystore on mac was at ~/.android/debug.keystore.

Command to get your SHA1 for the API key : keytool -list -v -keystore debug.keystore -alias androiddebugkey -storepass android -keypass android