开发者

Android Emulator does not detect GPS

I am trying to test an Android application that does GPS tracking. Unfortunately, I get t开发者_StackOverflow社区he 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?


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").


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜