Permission is only granted to system apps

来源:互联网 发布:python 使用多个def的 编辑:程序博客网 时间:2024/06/05 23:45

在添加一些系统权限时,我们会遇到编译出错的情况如下:



一、Elipse的解决方法

百度后,基本都是基于eclipse的解决方案:

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

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


二、Android Studio的解决方法

File -> Settings -> Editor -> Inspections

在Android Lint下面,将 Using system app permission的Error改成Warning。