分享

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

 quasiceo 2015-11-17

在AndroidManifest.xml中使用了如下的配置:
<uses-permission android:name="android.permission.INSTALL_PACKAGES" />


只要稍微修改一下AndroidManifest.xml,立刻会惊动警惕的编译器,它马上又打出一个红叉叉

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


方法1是点eclipse的菜单project->clean...,然后叉叉就不见了。


方法2

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.例如warning

原因如下:
此类权限仅授予系统级应用,可以修改下Link Error Checking项的安全级别;
In Eclipse: Window -> Preferences -> Android -> Lint Error Checking
在ID列表中,找到ID = ProtectedPermission,设置Serverity低于Error,比如Warning级别就好了。


    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多