1

I use the below in my code:

ContextCompat.checkSelfPermission(mContext, Manifest.permission.READ_PHONE_STATE)

In my gradle I have:

compile 'com.android.support:appcompat-v7:25.0.1'

Everything was working fine and the builds were triggering, however suddenly my builds are failing with the below error:

 error: package android.support.v4.content does not exist

in the import statement :android.support.v4.content.ContextCompat

Can someone please help out. Since this is happening on a build machine I dont have android studio in it.

AskNilesh
  • 63,753
  • 16
  • 113
  • 150
Sid
  • 1,144
  • 3
  • 22
  • 46

2 Answers2

0

just use this

Activity and extend from AppCompatActivity.

 compile 'com.android.support:appcompat-v7:25.3.1'
AskNilesh
  • 63,753
  • 16
  • 113
  • 150
Rasoul Miri
  • 7,206
  • 57
  • 67
0

Include this

compile 'com.android.support:support-v4:25.0.1'
Paolo Forgia
  • 6,202
  • 8
  • 42
  • 57
akshay_shahane
  • 3,963
  • 2
  • 14
  • 29