Xamarin android binding for new places sdk (Xamarin.Google.Android.Places/1.1.0.2) Issues

LeeNetLeeNet USMember ✭✭
edited September 11 in Xamarin.Android

Hello Everyone,

Good afternoon, is anyone else having issues with the following nuget package? I'm having issues with Autocomplete and I'm targeting Android 9 (PIE). Does anyone have a working example on github?

nuget/packages/Xamarin.Google.Android.Places/1.1.0.2

Best Answer

Answers

  • LeeNetLeeNet USMember ✭✭
    edited September 12

    Jarvan thanks. I have tried the sample project and believe I'm following it correctly. I provided below a sample of my code and the error I see in my debug window (VS2019 Xamarin Android). The error is not clear to me. Do you know if there is a property in Xamarin VS2019 that will show more detail error? Currently, my debug window is set to Diagnostic.

    Step 1 (OnCreate):
    if (!PlacesApi[dot]IsInitialized) {
    PlacesApi[dot]Initialize(this, GetString(Resource.String.google_api_key));
    }

    Step2 (Click Event, Start autocomplete overlay):
    private void AutoAddressAutoCompleteTextView_Click(object sender, EventArgs e)
    {
    var places = new List<Place.Field>();
    places.Add(Place.Field.Id);
    places.Add(Place.Field.Name);
    places.Add(Place.Field.LatLng);
    places.Add(Place.Field.Address);

            var intent = new Autocomplete.IntentBuilder(AutocompleteActivityMode.Overlay, places)
                .SetCountry("US").Build(this);
    
            StartActivityForResult(intent, 0);
        }
    

    Error (when typing in the autocomplete overlay search box):
    09-12 07:21:50.535 E/Places (30190): Error while autocompleting: ERROR

  • LeeNetLeeNet USMember ✭✭

    Jarvan I had to add the following to my proguard file.

    -keep class com[dot]google[dot]android[dot]libraries.** { *; }

  • RodrigoLiraRodrigoLira USMember ✭✭

    @LeeNet said:
    Jarvan I had to add the following to my proguard file.

    -keep class com[dot]google[dot]android[dot]libraries.** { *; }

    @LeeNet Thank you. This actually solved my issue.

Sign In or Register to comment.