Google PlacePicker Closes Immediately After Launch

前端 未结 7 1704
不知归路
不知归路 2021-01-07 16:16

I am developing an Android Application and was looking into Google Places for some functionality within the application. Google has recently released the PlacePicker feature

7条回答
  •  一生所求
    2021-01-07 16:59

    I believe that when Google made changes to their API's on 04/20/2015 they modified the places API that the PlacePicker inherently uses. The solution that worked for me is as follows:

    1. Go to your Google Developer Console (https://console.developers.google.com/project)
    2. Navigate to your project if you have made one. If not go here: https://developers.google.com/console/help/
    3. Navigate to "APIs & auth" then to "Credentials" on the left side of the console. I don't have enough rep to post a picture for guidance...
    4. Create a new Key, this appears under Public API access in your Credentials window. You will need your SHA1 Fingerprint to receive the key. Directions that I used are here: How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?
    5. The location that you input your SHA1 Fingerprint should be in this format: (Your Key, 20 Hex values separated by ":");com.yourpackage.yourapp
    6. Copy your API Key that is generated. You will need to add the fingerprint of each developer in the same format above for it to work for other developers.
    7. Add your key to your AndroidManifest.xml

    
    
    ... 
    Where the "@string/google_api_key" /> is the key that you just generated. Place it in your strings.xml file as such:

    yourkeyhere
    
    1. Clean and Rebuild your project. Should be working now. I don't think I left any steps out... Please comment if I have.

提交回复
热议问题