Android Place Picker closes immediately after launch

后端 未结 14 1318
难免孤独
难免孤独 2020-11-27 04:57

I am developing an android application as part of a project, and am using Google places API to display places of interest based on location. I am using the PlacePicker Inent

相关标签:
14条回答
  • 2020-11-27 05:38

    I filling out the Consent screen in APIs & Auth of the console and its working fine. Check the screen shot.

    0 讨论(0)
  • 2020-11-27 05:39

    In my case there was conflict of APIs. I have added google-service.json file which also had API key and I generated new key for Maps. So place picker was closing immediately. Solution :

    1. Use single API key which is in google-service.json file

    2. Enable "Places SDK for Android" feature for your Google Cloud Platform project (with same name as in Firebase project , don't use different project. You will find same name project as you are using in Firebase)

    3. Put SHA1 Application Restriction for android app (Recommended)
    4. Check if you have placed following code in Application tag only

          <meta-data
              android:name="com.google.android.geo.API_KEY"
              android:value="API_KEY" />
      
    0 讨论(0)
  • 2020-11-27 05:39

    The PlacePicker is now officially deprecated.

    I'm trying to complete the Udacity Advanced Android App Development course and running into the same issue. https://developers.google.com/places/android-sdk/client-migration#place-picker-deprecation says that

    The Place Picker was deprecated on January 29, 2019. It was turned off on July 29, 2019, and is no longer available. Continued use will result in an error message. The new SDK does not support the Place Picker.

    Cross-posting to https://github.com/googlemaps/android-places-demos/issues/2

    0 讨论(0)
  • 2020-11-27 05:41

    I was having the same issue. Make sure you enable Google Places API for Android and not just Places API in the Developer Console. "Places API for Android" will not show up under APIs & Auth/APIs because it isn’t a popular API (yet). You will have to search for it using the API search box.

    0 讨论(0)
  • 2020-11-27 05:43

    I'll just drop this here, maybe it helps someone in the future.

    For me, using the wrong Api key caused the crash, even though it worked fine in the past.

    I had to use the second key (the one that is auto-created by Google services for Android) instead of the first one which i created.

    0 讨论(0)
  • 2020-11-27 05:44

    The PlacePicker is now officially deprecated.

    Try this library. Light weight and similar to placepicker with some additional features.

    https://github.com/BilalSiddiqui/AddressPicker

    0 讨论(0)
提交回复
热议问题