Search code examples
androidgoogle-mapsgmsplacepicker

Android, Can't get a position that's not a place in google maps using PlacePicker


after choosing random postion that's not a place in Google Maps using PlacePicker (https://developers.google.com/places/android-api/placepicker), i used compile 'com.google.android.gms:play-services-places:9.4.0' the confirmation button is always disabled if the position not a registred place in Google Maps.enter image description here


Solution

  • You need to make sure you follow the complete setup guide for the Google Places API for Android: https://developers.google.com/places/android-api/start#app-config

    Of particular note, your issue can happen if you don't have an API key in your app manifest. You'll need to follow the steps to set up an Android API key for Google Places from the Google Developer Console, and then add it to you application manifest:

    <application>
    ...
        <meta-data>
            android:name="com.google.android.geo.API_KEY"
            android:value="YOUR_API_KEY"/>
    </application>
    

    You'll need to get an API key following the information in the Getting Started guide from Google.