Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Xamarin.iOS.Google.Places - Unrecognised selector sent to instance #530

Open
ckomo opened this issue Feb 22, 2022 · 5 comments
Open

Xamarin.iOS.Google.Places - Unrecognised selector sent to instance #530

ckomo opened this issue Feb 22, 2022 · 5 comments

Comments

@ckomo
Copy link

ckomo commented Feb 22, 2022

Hi, I have upgraded to the latest packages for:

  • Xamarin.iOS.Google.Maps
  • Xamarin.iOS.Google.Places

And am receiving a native crash related to retrieving autocomplete results. The affected method is:

void FindAutocompletePredictions (string query, [NullAllowed] CoordinateBounds bounds, AutocompleteBoundsMode boundsMode, [NullAllowed] AutocompleteFilter filter, [NullAllowed] AutocompleteSessionToken sessionToken, AutocompletePredictionsHandler callback);

Invoking this will result in:

Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[GMSPlacesClient findAutocompletePredictionsFromQuery:bounds:boundsMode:filter:sessionToken:callback:]: unrecognized selector sent to instance.

I believe this caused by changes in the Google Places library and the bindings have not been updated.

The method was deprecated in version 4.0: https://cloud.google.com/blog/products/maps-platform/announcing-version-40-maps-and-places-sdks-ios

The method was changed from:
findAutocompletePredictionsFromQuery:bounds:boundsMode:filter:sessionToken:callback
To:
findAutocompletePredictionsFromQuery:filter:sessionToken:callback

I have created a sample project that reproduces it: https://github.com/ckomo/xamarin_google_places_crash

Thanks for looking into this, hopefully I have included enough information.

-Chris

@dmariogatto
Copy link
Contributor

dmariogatto commented Feb 22, 2022

Hey Chris,

Great explanation! You're right the definition for that ObjC function call has changed,

- (void)findAutocompletePredictionsFromQuery:(NSString *)query
                                      filter:(nullable GMSAutocompleteFilter *)filter
                                sessionToken:(nullable GMSAutocompleteSessionToken *)sessionToken
                                    callback:(GMSAutocompletePredictionsCallback)callback;

I think this should also include the removal of CoordinateBounds & AutocompleteBoundsMode in a couple other spots as well as these are no longer used in Places 6.0.0 (dmariogatto@29c9abe).

@ckomo
Copy link
Author

ckomo commented Feb 22, 2022

Thanks for the quick reply, is there a time frame for this fix to be pushed out to Nuget package?

@dmariogatto
Copy link
Contributor

Unfortunately no, I'm happy to make a PR, but I don't know what the plans are for this project. With all the binding changes in the latest version and the large gap between releases there are a few errors that have been introduced.

I'm happy to help out, but this really requires dedicated resources from Microsoft, with a proper testing method, maybe a pre-release channel & multiple eyes to look over binding changes.

@johnclarete
Copy link

Yeah this would be good to get fixed also or if anyone else has found an alternative

@wiljoetradify
Copy link

Hi team,
Is there any update on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants