[android] Permission is only granted to system app

I have a System app that uses system permissions and I have those permissions listed in the manifest. Eclipse gives the following error when I try to make a build(command line build works):

Permission is only granted to system apps

I'm already aware that my app requires system permissions and it is not a problem for me because my application will be used only on rooted phones. So I want to suppress this error, anyone knows how?

EDIT
My project already compiles fine on command line, installs, runs etc.. My problem is about eclipse giving an error for a legit manifest file.

This question is related to android eclipse lint

The answer is


Preferences --> EditorEditor --> Inspections --> Android Lint --> uncheck item Using System app permissio


To ignore this error for one instance only, add the tools:ignore="ProtectedPermissions" attribute to your permission declaration. Here is an example:

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

You have to add tools namespace in the manifest root element

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"

tools:ignore="ProtectedPermissions"

Try adding this attribute to that permission.


Path In Android Studio in mac:

Android Studio -> Preferences -> Editor -> Inspections

Expand Android -> Expand Lint -> Expand Correctness

Uncheck the checkbox for Using system app permission

Click on "APPLY" -> "OK"


Have same error from time to time (when I set install location to "prefer external" in manifest). Just clean and rebuild project. Works for me.


when your add permission in manifest then in eclipse go to project and clic

  1. click on project
  2. click on clean project that's all

k on clean project


Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to eclipse

How do I get the command-line for an Eclipse run configuration? My eclipse won't open, i download the bundle pack it keeps saying error log strange error in my Animation Drawable How to uninstall Eclipse? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Class has been compiled by a more recent version of the Java Environment Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9 "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat

Examples related to lint

SyntaxError: unexpected EOF while parsing Turning off eslint rule for a specific file Permission is only granted to system app JSHint and jQuery: '$' is not defined What is "Linting"?