Google PlacePicker Closes Immediately After Launch with resultCode 2

前端 未结 3 1963
故里飘歌
故里飘歌 2021-01-06 00:34

In my project PlacePicker was working fine but today suddenly its closing immediately after launch with resultCode 2.

here is the logcat output

3条回答
  •  没有蜡笔的小新
    2021-01-06 01:13

    See here for info on the error code... It might throw a better error by now, but that used to mean something is wrong with your certificate fingerprints in the API Console.

    We were having a similar problem (PlacePicker closing immediately with result code 2, except we did not have any relevant console output). We ended up fixing our issue by removing all fingerprints to get it working and then slowly adding security back:

    • Remove all entries under "Restrict usage to your Android apps" on the page for your api key in the credentials section of the Google API console
    • On the same key page, click "regenerate key" at the top (yes -- this was actually required for us @_@... you could try the old key again before doing this)
    • Test your app with the new key

    If PlacePicker is now working, try adding security back in:

    https://developers.google.com/maps/documentation/android-api/signup

    Other info

    • Our devices were running Android API level 23 (Android 6.0)

    • Our app / module level build.gradle is using:

      compile 'com.google.android.gms:play-services-maps:9.0.0'
      compile 'com.google.android.gms:play-services-gcm:9.0.0'
      compile 'com.google.android.gms:play-services-location:9.0.0'
      
    • Our project level build.gradle is using:

      classpath 'com.google.gms:google-services:3.0.0'
      

      ```

提交回复
热议问题