0

I bumped into a very strange problem, the studio compiles all the manifest permissions except one:

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

Tested in other compilers - the permissions successfully compiled. How can you solve this truly strange problem? My full list of permissions:

<uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
congard
  • 913
  • 1
  • 9
  • 22

3 Answers3

0

If the app targets API level 23 or higher, the app user must explicitly grant this permission to the app through a permission management screen. The app requests the user's approval by sending an intent with action ACTION_MANAGE_OVERLAY_PERMISSION. The app can check whether it has this authorization by calling Settings.canDrawOverlays().

Remario
  • 3,651
  • 2
  • 15
  • 23
0

I solved this problem by modifying the build.gradle file. I changed targetSdkVersion from 26 to 19 (any version that <19) But I'm not sure if this is the best solution

congard
  • 913
  • 1
  • 9
  • 22
0

You cannot use SYSTEM_ALERT_WINDOW permission, because it has signature protection level.

See signature protection level - clarifying and see https://developer.android.com/guide/topics/manifest/permission-element.html

Also you cannot use BIND_ACCESSIBILITY_SERVICE permission, it has signature protection level too.

user2930077
  • 115
  • 1
  • 8