I am implementing runtime permission request for Marshmallow
devices. I have set my build and compile sdk
to API 23
. Still Manifest.permission.READ_PHONE_STATE
is not recognizable
Asked
Active
Viewed 1.0k times
12

Aditya Vyas-Lakhan
- 13,409
- 16
- 61
- 96

Aditya Borde
- 1,227
- 2
- 12
- 31
-
1try to clean and rebuild. – Rohit Arya Mar 23 '16 at 06:40
2 Answers
38
I had imported wrong package, the right package is
android.Manifest

Aditya Borde
- 1,227
- 2
- 12
- 31
-
I am already using `import android.Manifest;` but I still see the error `Cannot resolve symbol 'REQUEST_READ_PHONE_STATE'`. – Jaime Montoya Mar 12 '19 at 22:47
-
I fixed it. I needed to define `REQUEST_READ_PHONE_STATE`, since it is a constant. – Jaime Montoya Mar 13 '19 at 00:25
1
As in 23 sdk you can not use dangerous permission directly from manifest you have do rum time programming for this else drop down your target sdk to 22. List of dangerous permissions