消除“Permission is only granted to system apps”错误

时间:2023-03-09 02:17:01
消除“Permission is only granted to system apps”错误

遇见这个问题我百度搜了一大堆说是须要clean项目,可是我每次clean项目的时候我的R文件总是丢失。

如今我给大家介绍一下避免授予系统权限报错更改方法

在AndroidManifest.xml中使用了例如以下的配置:

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

就会报错:Permission is only granted to system apps

原因例如以下:

此类权限仅授予系统级应用,能够改动下Link Error Checking项的安全级别;

In Eclipse: Window -> Preferences -> Android -> Lint Error Checking

在ID列表中,找到ID = ProtectedPermission,设置Serverity低于Error。比方Warning级别就好了