问题
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 ?
回答1:
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
来源:https://stackoverflow.com/questions/8298732/unable-to-start-service-requires-access-mock-location-secure-setting