11

I got an exception

java.lang.RuntimeException: Unable to start service ...
java.lang.SecurityException: Requires ACCESS_MOCK_LOCATION secure setting

However I have in Manifest file:

<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />

What can be wrong ?

hsz
  • 148,279
  • 62
  • 259
  • 315

1 Answers1

41

The permission needs to be outside the <application> element.

Also, you will need to enable Mock Locations from Settings -> Applications -> Development (Nexus S, may vary on other devices).

Reference

Raghav Sood
  • 81,899
  • 22
  • 187
  • 195