title: RuntimeExecutionException: com.google.android.gms.common.api.ApiException: 13: ERROR Places API
body: <p>I am getting the following exception while trying out google places API to get likelihood places for <a href="https://developers.google.com/places/android-api/current-place" rel="noreferrer">Current Place</a> in android.</p>
  
  <pre><code>Process: me.nabeelkottol.linkedinplaces, PID: 2995
   com.google.android.gms.tasks.RuntimeExecutionException: 
   com.google.android.gms.common.api.ApiException: 13: ERROR
   at com.google.android.gms.tasks.zzn.getResult(Unknown Source)
   at 
   me.nabeelkottol.linkedinplaces.MainActivity$1.onComplete(MainActivity.java:71)
   at com.google.android.gms.tasks.zzf.run(Unknown Source)
   at android.os.Handler.handleCallback(Handler.java:739)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:148)
   at android.app.ActivityThread.main(ActivityThread.java:5417)
   at java.lang.reflect.Method.invoke(Native Method)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  Caused by: com.google.android.gms.common.api.ApiException: 13: ERROR
   at com.google.android.gms.common.internal.zzb.zzz(Unknown Source)
   at com.google.android.gms.common.internal.zzbk.zzaa(Unknown Source)
   at com.google.android.gms.common.internal.zzbl.zzs(Unknown Source)
   at com.google.android.gms.common.api.internal.zzs.zzc(Unknown Source)
   at com.google.android.gms.common.api.internal.zzs.setResult(Unknown Source)
   at com.google.android.gms.location.places.zzm.zzao(Unknown Source)
   at com.google.android.gms.location.places.internal.zzx.onTransact(Unknown Source)
   at android.os.Binder.execTransact(Binder.java:453)
  </code></pre>
  
  <p>this is my code: </p>
  
  <pre><code>try {
        Task&lt;PlaceLikelihoodBufferResponse&gt; placeResult = mPlaceDetectionClient.getCurrentPlace(null);
        placeResult.addOnCompleteListener(new OnCompleteListener&lt;PlaceLikelihoodBufferResponse&gt;() {
          @Override public void onComplete(@NonNull Task&lt;PlaceLikelihoodBufferResponse&gt; task) {
  
            PlaceLikelihoodBufferResponse likelyPlaces = task.getResult();
            for (PlaceLikelihood placeLikelihood : likelyPlaces) {
              Log.i(TAG,
                  String.format("Place '%s' has likelihood: %g", placeLikelihood.getPlace().getName(),
                      placeLikelihood.getLikelihood()));
            }
            likelyPlaces.release();
  
          }
        });
      } catch (SecurityException e) {
        e.printStackTrace();
      }
  </code></pre>
  
  <p>Here the line <code>PlaceLikelihoodBufferResponse likelyPlaces = task.getResult();</code> is giving me the error.</p>
  
  <p>I have created an <code>API key</code> for the android app by giving the package name and SHA-1 key for debug from <code>Google API console</code>. And <code>enabled Google Places API for android</code> in the <code>libraries</code> section. still its giving the same error. Dont know what is wrong with the implementation. Please help me.</p>
  
  <p>There is an <a href="https://github.com/googlemaps/android-samples/issues/73#issuecomment-343696856" rel="noreferrer">issue</a> reported in github regarding this.</p>
  
  <p>This is my <code>app/build.gradle</code></p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 26
      defaultConfig {
          applicationId "me.nabeelkottol.linkedinplaces"
          minSdkVersion 16
          targetSdkVersion 26
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation 'com.android.support:appcompat-v7:26.1.0'
      implementation 'com.android.support.constraint:constraint-layout:1.0.2'
      compile 'com.google.android.gms:play-services-places:11.6.0'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.1'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
  }
  </code></pre>
  
  <p>This is my <code>AndroidManifest.xml</code>.</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="me.nabeelkottol.linkedinplaces"&gt;
  
    &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
    &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  
    &lt;application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"&gt;
      &lt;meta-data
          android:name="com.google.android.geo.API_KEY"
          android:value="My API Key here"/&gt;
  
      &lt;activity android:name=".MainActivity"&gt;
        &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.MAIN"/&gt;
  
          &lt;category android:name="android.intent.category.LAUNCHER"/&gt;
        &lt;/intent-filter&gt;
      &lt;/activity&gt;
    &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>