title: Geofence creation error in Android-Q- "com.google.android.gms.common.api.ApiException: 13"
body: <p>I've a Geofence implemented app which has been working fine on Android versions below Q. On Android-Q, geofence creation gets succeed when I choose <strong>"Allow location all time"</strong> but fails to create when I choose <strong>"Allow only while using the app"</strong>.</p>
  
  <p><strong>Device:</strong> Google Pixel 2 XL
  <strong>O/S:</strong> Android-Q beta, last security patch update August 1, 2019</p>
  
  <p>The error in case of choosing Allow only while using the app is **com.google.android.gms.common.api.ApiException: 13: **</p>
  
  <p><strong>The stacktrace is below:</strong></p>
  
  <pre><code>2019-08-26 12:06:29.749 17668-17668/com.bdx.newhomesource.debug W/System.err: com.google.android.gms.common.api.ApiException: 13: 
  2019-08-26 12:06:29.750 17668-17668/com.bdx.newhomesource.debug W/System.err:     at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(Unknown Source:4)
  2019-08-26 12:06:29.752 17668-17668/com.bdx.newhomesource.debug W/System.err:     at com.google.android.gms.common.internal.zai.zaf(Unknown Source:2)
  2019-08-26 12:06:29.753 17668-17668/com.bdx.newhomesource.debug W/System.err:     at com.google.android.gms.common.internal.zaj.onComplete(Unknown Source:6)
  2019-08-26 12:06:29.754 17668-17668/com.bdx.newhomesource.debug W/System.err:     at com.google.android.gms.common.api.internal.BasePendingResult.zaa(Unknown Source:172)
  2019-08-26 12:06:29.755 17668-17668/com.bdx.newhomesource.debug W/System.err:     at com.google.android.gms.common.api.internal.BasePendingResult.setResult(Unknown Source:131)
  2019-08-26 12:06:29.757 17668-17668/com.bdx.newhomesource.debug W/System.err:     at com.google.android.gms.common.api.internal.BaseImplementation$ApiMethodImpl.setResult(Unknown Source:36)
  2019-08-26 12:06:29.758 17668-17668/com.bdx.newhomesource.debug W/System.err:     at com.google.android.gms.internal.location.zzba.zza(Unknown Source:22)
  2019-08-26 12:06:29.759 17668-17668/com.bdx.newhomesource.debug W/System.err:     at com.google.android.gms.internal.location.zzan.dispatchTransaction(Unknown Source:47)
  2019-08-26 12:06:29.760 17668-17668/com.bdx.newhomesource.debug W/System.err:     at com.google.android.gms.internal.location.zzb.onTransact(Unknown Source:22)
  2019-08-26 12:06:29.762 17668-17668/com.bdx.newhomesource.debug W/System.err:     at android.os.Binder.execTransactInternal(Binder.java:1021)
  2019-08-26 12:06:29.764 17668-17668/com.bdx.newhomesource.debug W/System.err:     at android.os.Binder.execTransact(Binder.java:994)
  </code></pre>