Awareness API。在某些手机上获取定位.失败

问题描述 投票:8回答:1
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.com.api.ApiException。17: API.ContextManager.API在此设备上不可用。ContextManager.API is not available on this device.

我收到这个错误作为一个异常,当运行在Android 9本质的手机上的应用程序,但没有异常,当运行在Android 8三星s8。

我已经更新到最新的16.0.0意识包。

android google-api android-8.0-oreo android-9.0-pie google-awareness
1个回答
0
投票

在我的例子中,从以下地方激活Awareness API https:/console.developer.google.com。 为我的项目解决了这个问题。

© www.soinside.com 2019 - 2024. All rights reserved.