Reputation: 501
I'm developing an app that uses LocationManager.GPS_PROVIDER to request location updates. Everything is working on my Samsung Galaxy S5, but in the emulator I get the exception "java.lang.IllegalArgumentException: provider doesn't exist: gps" when calling requestLocationUpdates().
GPS is enabled in the emulator (both in "Settings" and "Google Settings") and it is set to "High Accuracy".
I've tried setting the location via Android Studio's Extended emulator controls, and using the command line (telnet, geo fix lat lon alt).
The latest SDK tools are installed (25.2.2 rc1), and the emulator is using these ("About" displays Emulator version 25.2.2-3098464).
Thanks for your help
Upvotes: 1
Views: 3021
Reputation: 973
If you list the providers available in the API19 emulator (getAllProviders) you will notice that gps is not available. API22 Emulator has not this mistake.
Upvotes: 0
Reputation: 501
My emulator was using API 19 (the same as my real device). I just tried creating a new one using API 22, and in this emulator it does work. Still no clue as to why it doesn't work on the other emulator, all system images/SDK tools are installed and everything seems properly configured.
Upvotes: 0