Home » Android » Error: Permission is only granted to system apps [ProtectedPermissions]

Error: Permission is only granted to system apps [ProtectedPermissions]

When compiling and android application, we may get an error as,

app/src/main/AndroidManifest.xml:13: Error: Permission is only granted to system apps [ProtectedPermissions]
    <uses-permission android:name="android.permission.SOME_PERMISSION" />
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Solution : 1)

This error can be resolved by modifying the build.gradle file as,

android {
    lintOptions {
        disable 'ProtectedPermissions'
    }
}

2) This can also be resolved by modifying AndroidManifest.xml by adding suppression attribute tools:ignore="ProtectedPermissions"

<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:tools="http://schemas.android.com/tools">
    ...
    <uses-permission tools:ignore="ProtectedPermissions" .../>
  ...
</manifest>

Subscribe our Rurban Life YouTube Channel.. "Rural Life, Urban LifeStyle"

Leave a Comment