2

I added these permissions to my app some months ago, and Eclipse never showed and error:

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

Today, however, I edited the Android manifest file, and now it shows an error:

Permission is only granted to system apps

Why? How do I fix this problem?

gonzobrains
  • 7,856
  • 14
  • 81
  • 132
mum
  • 1,637
  • 11
  • 34
  • 58

2 Answers2

2

Eclipse is doing you a favor -- that really is an error. Only apps signed with Google's signing key can install or delete apps.

You can probably suppress those error messages by configuring your lint options in Eclipse (see https://stackoverflow.com/a/16457801/338479), but unless you actually work for Google and have access to their signing key, you can't set those permissions.

Well, maybe on a rooted device, but your app won't exactly be portable.

Edit: or did you change your SDK target version? Perhaps older versions of Android allowed you to have those permissions, but now you've targeted a version that doesnt?

Community
  • 1
  • 1
Edward Falk
  • 9,991
  • 11
  • 77
  • 112
0

In Eclipse:

Window -> Preferences -> Android -> Lint Error Checking.

In the list find an entry with ID = ProtectedPermission. Set the Severity to something lower than Error. This way you can still compile the project using Eclipse.

In Android Studio:

File -> Settings -> Inspections

Under Android Lint, locate Using system app permission. Either uncheck the checkbox or choose a Severity lower than Error.

Sathish
  • 1,455
  • 1
  • 16
  • 22