Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to start service - Requires ACCESS_MOCK_LOCATION secure setting

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 ?

like image 443
hsz Avatar asked Nov 28 '11 16:11

hsz


1 Answers

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

like image 65
Raghav Sood Avatar answered Oct 09 '22 00:10

Raghav Sood