谷歌地理围栏应用程序[重复]

Posted

技术标签:

【中文标题】谷歌地理围栏应用程序[重复]【英文标题】:Google Geo-fencing App [duplicate] 【发布时间】:2017-06-18 03:47:24 【问题描述】:

我正在尝试 google 地理围栏它抛出错误运行时:

E/androidRuntime: FATAL EXCEPTION: main
                  Process: com.bipin.geofencexample, PID: 23251
                  java.lang.SecurityException: Geofence usage requires ACCESS_FINE_LOCATION permission
                      at android.os.Parcel.readException(Parcel.java:1599)
                      at android.os.Parcel.readException(Parcel.java:1552)
                      at com.google.android.gms.internal.zzarr$zza$zza.zza(Unknown Source)
                      at com.google.android.gms.internal.zzaru.zza(Unknown Source)
                      at com.google.android.gms.internal.zzaro$1.zza(Unknown Source)
                      at com.google.android.gms.internal.zzaro$1.zza(Unknown Source)
                      at com.google.android.gms.internal.zzzv$zza.zzb(Unknown Source)
                      at com.google.android.gms.internal.zzaai.zzd(Unknown Source)
                      at com.google.android.gms.internal.zzaai.zzb(Unknown Source)
                      at com.google.android.gms.internal.zzaan.zzb(Unknown Source)
                      at com.google.android.gms.internal.zzaal.zzb(Unknown Source)
                      at com.google.android.gms.internal.zzaro.addGeofences(Unknown Source)
                      at com.google.android.gms.internal.zzaro.addGeofences(Unknown Source)
                      at com.bipin.geofencexample.MainActivity.onConnected(MainActivity.java:140)
                      at com.google.android.gms.common.internal.zzm.zzq(Unknown Source)
                      at com.google.android.gms.internal.zzaal.zzo(Unknown Source)
                      at com.google.android.gms.internal.zzaaj.zzvE(Unknown Source)
                      at com.google.android.gms.internal.zzaaj.onConnected(Unknown Source)
                      at com.google.android.gms.internal.zzaan.onConnected(Unknown Source)
                      at com.google.android.gms.internal.zzzy.onConnected(Unknown Source)
                      at com.google.android.gms.common.internal.zzl$1.onConnected(Unknown Source)
                      at com.google.android.gms.common.internal.zzf$zzj.zzwZ(Unknown Source)
                      at com.google.android.gms.common.internal.zzf$zza.zzc(Unknown Source)
                      at com.google.android.gms.common.internal.zzf$zza.zzu(Unknown Source)
                      at com.google.android.gms.common.internal.zzf$zze.zzxa(Unknown Source)
                      at com.google.android.gms.common.internal.zzf$zzd.handleMessage(Unknown Source)
                      at android.os.Handler.dispatchMessage(Handler.java:111)
                      at android.os.Looper.loop(Looper.java:207)
                      at android.app.ActivityThread.main(ActivityThread.java:5769)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)

【问题讨论】:

【参考方案1】:

您是否在 AndroidManifest.xml 中添加了以下权限?

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

【讨论】:

以上是关于谷歌地理围栏应用程序[重复]的主要内容,如果未能解决你的问题,请参考以下文章

Android O 地理围栏触发延迟

应用程序在后台 ios 中时地理围栏不起作用

地理围栏有效,但一段时间后停止触发

如何使地理围栏准确?

谷歌地理围栏不工作,总是 GEOFENCE_NOT_AVAILABLE

谷歌地理围栏不起作用,总是GEOFENCE_NOT_AVAILABLE