2

In my project I have two permissions:

android.permission.USE_CREDENTIALS

android.permission.MANAGE_ACCOUNTS

that was removed in API Level 23 https://developer.android.com/sdk/api_diff/23/changes/android.Manifest.permission

Does that mean I can remove them if my targetSdkVersion is 23 or higher or minSdkVersion must be 23?

Community
  • 1
  • 1
Giks91
  • 273
  • 3
  • 5
  • 20

1 Answers1

1

No you need to add android:maxSdkVersion="22" to these both permissions. Like below

<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" android:maxSdkVersion="22" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" android:maxSdkVersion="22"/>

Everything every Android Developer must know about new Android's Runtime Permission is a very good article for more info. And found Android M Permissions: Missing some of the old ones similar to your issue.

Pankaj Kumar
  • 81,967
  • 29
  • 167
  • 186
  • Why? Let's say my targetSdkVersion is 23 but I also support older devices so minSdkVersion is 16 do I need them? – Giks91 Jul 12 '18 at 12:07
  • @Giks91 Yes. It will say framework that if your application is running on 23 or later, do not ask these permissions. But if application is running below 23 allow these permission (in default way) – Pankaj Kumar Jul 12 '18 at 12:13