• <legend id='0TeQL'><style id='0TeQL'><dir id='0TeQL'><q id='0TeQL'></q></dir></style></legend>
    <tfoot id='0TeQL'></tfoot>
  • <i id='0TeQL'><tr id='0TeQL'><dt id='0TeQL'><q id='0TeQL'><span id='0TeQL'><b id='0TeQL'><form id='0TeQL'><ins id='0TeQL'></ins><ul id='0TeQL'></ul><sub id='0TeQL'></sub></form><legend id='0TeQL'></legend><bdo id='0TeQL'><pre id='0TeQL'><center id='0TeQL'></center></pre></bdo></b><th id='0TeQL'></th></span></q></dt></tr></i><div id='0TeQL'><tfoot id='0TeQL'></tfoot><dl id='0TeQL'><fieldset id='0TeQL'></fieldset></dl></div>

        • <bdo id='0TeQL'></bdo><ul id='0TeQL'></ul>

        <small id='0TeQL'></small><noframes id='0TeQL'>

      1. 仅限 ACCESS_FINE_LOCATION 权限错误模拟器

        时间:2023-09-02

            1. <legend id='mvuUa'><style id='mvuUa'><dir id='mvuUa'><q id='mvuUa'></q></dir></style></legend>
                <tbody id='mvuUa'></tbody>
              <i id='mvuUa'><tr id='mvuUa'><dt id='mvuUa'><q id='mvuUa'><span id='mvuUa'><b id='mvuUa'><form id='mvuUa'><ins id='mvuUa'></ins><ul id='mvuUa'></ul><sub id='mvuUa'></sub></form><legend id='mvuUa'></legend><bdo id='mvuUa'><pre id='mvuUa'><center id='mvuUa'></center></pre></bdo></b><th id='mvuUa'></th></span></q></dt></tr></i><div id='mvuUa'><tfoot id='mvuUa'></tfoot><dl id='mvuUa'><fieldset id='mvuUa'></fieldset></dl></div>
                  <bdo id='mvuUa'></bdo><ul id='mvuUa'></ul>
                  <tfoot id='mvuUa'></tfoot>

                  <small id='mvuUa'></small><noframes id='mvuUa'>

                  本文介绍了仅限 ACCESS_FINE_LOCATION 权限错误模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我只在使用模拟器时遇到了一个奇怪的错误.我发现了一个 9 个月前有相同问题的问题,但根本没有答案...

                  我正在使用谷歌播放服务位置来获取我的应用程序中的位置,并且我确定我的清单权限并且一切都在我的手机上完美运行,仅使用模拟器时会出现问题,我在两者上都尝试了不同的模拟器我的 iMac 和 Windows 机器.

                  我怀疑模拟器不支持这个基本功能!

                  这是我的清单代码:

                  <?xml version="1.0" encoding="utf-8"?><清单 xmlns:android="http://schemas.android.com/apk/res/android"包="com.orderme.ordermeandroid" ><uses-permission android:name="android.permission.INTERNET"></uses-permission><使用权限android:name="android.permission.ACCESS_COARSE_LOCATION"/><使用权限android:name="android.permission.ACCESS_FINE_LOCATION"/>

                  这里是触发异常的地方:

                   LocationRequest mLLocationRequest = new LocationRequest();mLocationRequest.setInterval(10000);mLocationRequest.setFastestInterval(5000);mLLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient,mLocationRequest,this);

                  堆栈跟踪:

                  08-26 14:01:19.699 10157-10157/com.orderme.ordermeandroid E/AndroidRuntime: 致命例外:主要进程:com.orderme.ordermeandroid,PID:10157java.lang.SecurityException:客户端必须具有 ACCESS_FINE_LOCATION 权限才能请求 PRIORITY_HIGH_ACCURACY 位置.在 android.os.Parcel.readException(Parcel.java:1599)在 android.os.Parcel.readException(Parcel.java:1552)在 com.google.android.gms.location.internal.zzg$zza$zza.zza(未知来源)在 com.google.android.gms.location.internal.zzi.zza(未知来源)在 com.google.android.gms.location.internal.zzj.zza(未知来源)在 com.google.android.gms.location.internal.zzd$1.zza(未知来源)在 com.google.android.gms.location.internal.zzd$1.zza(未知来源)在 com.google.android.gms.common.api.zzc$zza.zzb(未知来源)在 com.google.android.gms.common.api.zzf.zza(未知来源)在 com.google.android.gms.common.api.zzf.zzb(未知来源)在 com.google.android.gms.common.api.zzi.zzb(未知来源)在 com.google.android.gms.location.internal.zzd.requestLocationUpdates(未知来源)在 com.orderme.ordermeandroid.Main.MainActivity.onConnected(MainActivity.java:184)在 com.google.android.gms.common.internal.zzk.zzh(未知来源)在 com.google.android.gms.common.api.zzg.zznt(未知来源)在 com.google.android.gms.common.api.zzg.onConnected(未知来源)在 com.google.android.gms.common.api.zzi$2.onConnected(未知来源)在 com.google.android.gms.common.internal.zzj$zzg.zzoD(未知来源)在 com.google.android.gms.common.internal.zzj$zza.zzc(未知来源)在 com.google.android.gms.common.internal.zzj$zza.zzs(未知来源)在 com.google.android.gms.common.internal.zzj$zzc.zzoF(未知来源)在 com.google.android.gms.common.internal.zzj$zzb.handleMessage(未知来源)在 android.os.Handler.dispatchMessage(Handler.java:102)在 android.os.Looper.loop(Looper.java:148)在 android.app.ActivityThread.main(ActivityThread.java:5417)在 java.lang.reflect.Method.invoke(本机方法)在 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)在 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

                  解决方案

                  我的猜测是您在 Android 6.0+ 模拟器上运行此程序,并且您的 targetSdkVersion 为 23 或更高.p>

                  在这种情况下,ACCESS_COARSE_LOCATIONACCESS_FINE_LOCATION 是 Android 6.0 运行时权限系统.修改您的应用以加入此系统,或将您的 targetSdkVersion 降至 23 以下.

                  I'm having a weird error while using the emulator ONLY. I found one question that has the same issue 9 months ago with no answers at all...

                  I'm using google play services locations to get locations in my app and I'm sure of my manifest permissions and everything works perfectly on my phone, the problem occurs when using an emulator only, and I tried different emulators on both my iMac and Windows machines.

                  I doubt that emulators don't support this basic function!

                  here is my manifest code:

                  <?xml version="1.0" encoding="utf-8"?>
                  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
                      package="com.orderme.ordermeandroid" >
                  <uses-permission android:name="android.permission.INTERNET"></uses-permission>
                  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
                  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
                  

                  and here is where the exception is firing:

                      LocationRequest mLocationRequest = new LocationRequest();
                      mLocationRequest.setInterval(10000);
                      mLocationRequest.setFastestInterval(5000);
                      mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
                      LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient,mLocationRequest,this);
                  

                  stack trace:

                  08-26 14:01:19.699  10157-10157/com.orderme.ordermeandroid E/AndroidRuntime﹕ FATAL EXCEPTION: main
                  Process: com.orderme.ordermeandroid, PID: 10157
                  java.lang.SecurityException: Client must have ACCESS_FINE_LOCATION permission to request PRIORITY_HIGH_ACCURACY locations.
                          at android.os.Parcel.readException(Parcel.java:1599)
                          at android.os.Parcel.readException(Parcel.java:1552)
                          at com.google.android.gms.location.internal.zzg$zza$zza.zza(Unknown Source)
                          at com.google.android.gms.location.internal.zzi.zza(Unknown Source)
                          at com.google.android.gms.location.internal.zzj.zza(Unknown Source)
                          at com.google.android.gms.location.internal.zzd$1.zza(Unknown Source)
                          at com.google.android.gms.location.internal.zzd$1.zza(Unknown Source)
                          at com.google.android.gms.common.api.zzc$zza.zzb(Unknown Source)
                          at com.google.android.gms.common.api.zzf.zza(Unknown Source)
                          at com.google.android.gms.common.api.zzf.zzb(Unknown Source)
                          at com.google.android.gms.common.api.zzi.zzb(Unknown Source)
                          at com.google.android.gms.location.internal.zzd.requestLocationUpdates(Unknown Source)
                          at com.orderme.ordermeandroid.Main.MainActivity.onConnected(MainActivity.java:184)
                          at com.google.android.gms.common.internal.zzk.zzh(Unknown Source)
                          at com.google.android.gms.common.api.zzg.zznt(Unknown Source)
                          at com.google.android.gms.common.api.zzg.onConnected(Unknown Source)
                          at com.google.android.gms.common.api.zzi$2.onConnected(Unknown Source)
                          at com.google.android.gms.common.internal.zzj$zzg.zzoD(Unknown Source)
                          at com.google.android.gms.common.internal.zzj$zza.zzc(Unknown Source)
                          at com.google.android.gms.common.internal.zzj$zza.zzs(Unknown Source)
                          at com.google.android.gms.common.internal.zzj$zzc.zzoF(Unknown Source)
                          at com.google.android.gms.common.internal.zzj$zzb.handleMessage(Unknown Source)
                          at android.os.Handler.dispatchMessage(Handler.java:102)
                          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)
                  

                  解决方案

                  My guess is that you are running this on an Android 6.0+ emulator and you have a targetSdkVersion of 23 or higher.

                  In that case, ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION are part of the Android 6.0 runtime permission system. Either revise your app to participate in this system, or drop your targetSdkVersion below 23.

                  这篇关于仅限 ACCESS_FINE_LOCATION 权限错误模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:基于经纬度进行半径搜索的SQL查询 下一篇:Android Phonegap - 如何打开原生谷歌地图应用程序

                  相关文章

                  最新文章

                  1. <small id='2tr8D'></small><noframes id='2tr8D'>

                  2. <i id='2tr8D'><tr id='2tr8D'><dt id='2tr8D'><q id='2tr8D'><span id='2tr8D'><b id='2tr8D'><form id='2tr8D'><ins id='2tr8D'></ins><ul id='2tr8D'></ul><sub id='2tr8D'></sub></form><legend id='2tr8D'></legend><bdo id='2tr8D'><pre id='2tr8D'><center id='2tr8D'></center></pre></bdo></b><th id='2tr8D'></th></span></q></dt></tr></i><div id='2tr8D'><tfoot id='2tr8D'></tfoot><dl id='2tr8D'><fieldset id='2tr8D'></fieldset></dl></div>
                    <legend id='2tr8D'><style id='2tr8D'><dir id='2tr8D'><q id='2tr8D'></q></dir></style></legend>
                    <tfoot id='2tr8D'></tfoot>
                        <bdo id='2tr8D'></bdo><ul id='2tr8D'></ul>