简体   繁体   中英

Google Awareness API Places with com.google.android.gms.common.api.ApiException: 7508

I unsuccessfully try to solve my Google Awareness Api Exception Problem for days now.

I do have implemented a Awareness Snapshot Client to resolve the current POI nearby for my context collection application. But unfortunately I always get the exception "com.google.android.gms.common.api.ApiException: 7508" without any results. I've also implemented a SnapshotClient for receiving current weather conditions and it works with good results. It's nearly the same code , but the one for Weather works fine and the one for Places don't.

I'm browsing the net for days now to solve this problem, but there is no information about that specific exception code and it's also not handled in the official android documentation.

Please help me out!!

My code is:

public String measure() {
   if(checkPermission() && resultWasFetched){
        resultWasFetched = false;
        Awareness.getSnapshotClient(this.context).getPlaces()
                .addOnSuccessListener(new OnSuccessListener<PlacesResponse>() {
                    @Override
                    public void onSuccess(PlacesResponse placesResponse) {
                        placeLikelihoods = placesResponse.getPlaceLikelihoods();
                        resultWasFetched = true;
                        Log.i(TAG, "detected: "+ placeLikelihoods);
                    }
                }).addOnFailureListener(new OnFailureListener() {
            @Override
            public void onFailure(@NonNull Exception e) {
                Log.e(TAG, "Could not detect places: " + e);
            }
        });
    }

I'm new to stackoverflow, so sorry if there is something missing or a problem with anything else!

Check to make sure you have an API key for Google Maps. You can get the api key and enable through the Google API Manager. Without it, you will not be authenticated to access maps. Places, you might imagine, runs off the back of Google Maps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM