7

I'm trying to use UsageStatsManager. I understand that I need to put the following into my Android manifest:

<uses-permission
    android:name="android.permission.PACKAGE_USAGE_STATS"
    tools:ignore="ProtectedPermissions" />

However, Eclipse throws the following error when I try that: The prefix "tools" for attribute "tools:ignore" associated with an element type "uses-permission" is not bound.

How do I declare the permission properly?

user1118764
  • 9,255
  • 18
  • 61
  • 113

2 Answers2

35

In your manifest file, you have to add the tools namespace. You can declare it this way:

xmlns:tools="http://schemas.android.com/tools"

for example in the manifest tag:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">
.
.
.
</manifest>
Erik Minarini
  • 4,795
  • 15
  • 19
5

Add this to your manifest tag:

xmlns:tools="http://schemas.android.com/tools"
R. Zagórski
  • 20,020
  • 5
  • 65
  • 90