RuntimeExecutionException: com.google.android.gms.common.api.ApiException: 13: ERROR Places API

前端 未结 8 1918
陌清茗
陌清茗 2020-12-06 04:14

I am getting the following exception while trying out google places API to get likelihood places for Current Place in android.

Process: me.nabeelkottol.linke         


        
相关标签:
8条回答
  • 2020-12-06 04:47

    OK. I hope you didn't have to waste as much time as I did to find out this. But to get @Umar Ata 's answer working you need to put in both of the meta-data tags in your manifest file. So it should go like this.

    <application>
    ...
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    
    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="PASTE_YOUR_API_KEY_HERE" />
    ...    
    </application>
    

    And even after getting everything right it gave me error: PLACES_API_ACCESS_NOT_CONFIGURED 9003 which I got fixed by enabling Places SDK for Android and things finally got well.

    0 讨论(0)
  • 2020-12-06 04:48

    I also experienced this exception when location settings were turned off. Before making the API call please make sure that you have turned on the location services.

    0 讨论(0)
  • 2020-12-06 04:50

    Please try following hope so it will be working.

    1) please updated your \sdk\extras\google\google_play_services and try again.

    2)If you are use proguard please excluded google classes from obfuscating like this in proguard-rules.pro:

    -keep public class com.google.** {*;}
    

    3) Versions of play-services libs should be equal, for example:

    compile 'com.google.android.gms:play-services-maps:11.6.0'
    compile 'com.google.android.gms:play-services-gcm:11.6.0'
    

    4)I just had this issue but solved it by downgrading the gradle version like so:

    Old, troublesome version:

     classpath 'com.android.tools.build:gradle:2.2.0-rc2'
    

    Fixed version:

    classpath 'com.android.tools.build:gradle:2.3.3'
    

    and don't forget to add following dependency in project level gradle file.

     dependencies {
            classpath 'com.android.tools.build:gradle:2.3.3'
            classpath 'com.google.gms:google-services:3.1.0'
    
        } 
    
    0 讨论(0)
  • 2020-12-06 05:01

    Add the below code in manifest

     <meta-data
                android:name="com.google.android.gms.version"
                android:value="@integer/google_play_services_version" />
    
    0 讨论(0)
  • 2020-12-06 05:03

    Well in my case both com.google.android.gms.version and com.google.android.geo.API_KEY were already added in manifest. Why this error occurred because i switched my project into a new system the sha1 key didn't matched from the list.

    What i did to resolve this error is: I have generated new SHA1 from my new system and added this SHA1 in under

    credentials=> API Key=> then Add package name and SHA1

    of Places SDK for Android

    0 讨论(0)
  • 2020-12-06 05:11

    I had the same issue, I was able to resolve it by enabling Google places Api from Google console and adding places api key. As soon as you enable the Places api, it will automatically ask you to add api key, just follow the instructions.

    Then add the API key in your manifest file.

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

    Also, your emulator should have latest Google Play Services installed. Else use real Android device for testing.

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