来自漏洞报告:
On all in-house test devices everything runs fine with debug and release builds. However, for some users out there we get crash reports that indicate a problem with the API:
Fatal Exception: java.lang.SecurityException: Invalid API Key for package = de.stocard.stocard .Status code received = -1 at android.os.Parcel.readException(Parcel.java:1620) at android.os.Parcel.readException(Parcel.java:1573) at com.google.android.gms.common.internal.zzu$zza$zza.zza(Unknown Source) at com.google.android.gms.common.internal.zzd.zzqz(Unknown Source) at com.google.android.gms.internal.zzpw$zzc.zzapl(Unknown Source) at com.google.android.gms.internal.zzpw$zzf.run(Unknown Source) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at com.google.android.gms.internal.zzrn.run(Unknown Source) at java.lang.Thread.run(Thread.java:818)
This happens on Android versions ranging from 4.4.2 to 7.0 with no noticeable pattern. The same applies to the device model and manufacturer: many and multiple manufacturers and models.
这听起来像是一个非常严重的Heisenbug。
更新:
在Android中似乎有两种不同的地理围栏实现方式:
我们需要使用Awareness API以获得我们所需的功能和省电性。
注意:
我看到有1个关闭投票,原因是“主要基于意见”。所以,请让我明确,我不想要不支持的意见答案。我想要事实、参考或具体专业知识。我已经进行了研究并引用了一个没有可靠解决方案的随机崩溃错误。我希望其他人注意到他们已经成功实现了地理围栏,并且要么:
- 他们的应用程序从未遇到过这个 bug(良好的崩溃报告从未捕获到“包的无效 API 密钥”)
- 曾经看到过这个 bug 并成功实施了修复
- 从未见过这个 bug