FernandoPR
FernandoPR

Reputation: 123

Android Emulator does not detect GPS

I am trying to test an Android application that does GPS tracking. Unfortunately, I get the following error when installing the app on the emulator:

Package: com.google.android.maps.appname requires unavailable feature android.hardware.location.gps; failing!

The virtual device that I am using is "Google APIs (Google Inc.) 8" and I made sure that GPS was included in the hardware list.

The error above I believe happens at the following point in the manifest:

<uses-feature android:name="android.hardware.location.gps" android:required="true"/>

Does anyone know what the cause of this error might be and what I can do to fix it?

Upvotes: 4

Views: 3771

Answers (2)

Patrick
Patrick

Reputation: 2087

I was running into the same issue using SDK tools r11. Problem was that I just had the uses-feature attribute as "required" and not "android:required". Doesn't look like it is the same issue you had, but it does at least appear to be fixed.

Upvotes: 1

Jared Casper
Jared Casper

Reputation: 168

You can change the android:required="true" to "false", and it'll let it install. I don't know why it doesn't think the feature is available.

Also, for me this only happens when the target of the AVD is API level 8+. So as a workaround, if you are not using something new in 2.2, you may be able to use API level 7 instead (i.e. set the target of the AVD to "Google APIs (Google Inc.) 7").

Upvotes: 2

Related Questions