Emulator's Location simulation not working

后端 未结 13 2014
鱼传尺愫
鱼传尺愫 2020-12-02 19:41

I would like to lower the minimum API level of my application to 4.4(KitKat) from 5.0(Lollipop)

Sadly I couldn\'t get any real devices

相关标签:
13条回答
  • 2020-12-02 20:18

    I had the same problem with the SDK Tools version 25.1.7. I've updated them to 25.2 rc1 and it now works.

    Beware that you cannot install the RC version from Android Studio. You have to launch the separate Android SDK Manager to see it.

    Relaunch the emulator and check that you are indeed using the latest version in the Help/About screen of the Extended Controls windows.

    0 讨论(0)
  • 2020-12-02 20:19

    Using OS X and Android Studio, had the same problem and what worked for me was: going to the actual phone (emulator) Settings, Location, and turning off the location and turning it back on. Tested again, and started working.

    I think it doesn't matter that much, but the Emulator version: 26.0.3-3965150.

    0 讨论(0)
  • 2020-12-02 20:21

    on one Android emulator @Emre's answer worked, and on the other it also took a restart using the simulator Power button

    0 讨论(0)
  • 2020-12-02 20:23

    I had the same problem with the FusedLocationProviderClient I resolved it by adding code to the addOnFailureListener in the SettingsClient object which exposes a ResolvableApiException object. I simply made a call to:

    (resolvableApiException as ResolvableApiException).startResolutionForResult(mainActivity, 6)
    

    This showed a popup with which I responded 'OK' and the AVD issue was resolved. Hope this helps.

    0 讨论(0)
  • 2020-12-02 20:24

    a simple emulator restart did the job for me (long click on shutdown button and select restart)

    0 讨论(0)
  • 2020-12-02 20:27

    I had to set the location to Device Only on the emulator for it to work. Sometimes have to switch between modes. Device only forces the use of GPS only and not WiFi, Bluetooth, etc.

    0 讨论(0)
提交回复
热议问题