WakefulBroadcastReceiver cannot be resolved to a type

前端 未结 8 1253
日久生厌
日久生厌 2021-01-01 18:01

My project shows error message that WakefulBroadcastReceiver cannot be resolved to a type. I looked up for all possible reasons I can think of. I have set

8条回答
  •  执念已碎
    2021-01-01 18:10

    I had this problem today here's how I fixed it:

    It's due to the Android Support JAR not being updated like the SDK manager one. You can delete it from your libs folder then do this:

    1. right click project
    2. Go to Android Tools
    3. Add Support Library

    Here 's a screenshot enter image description here

    Then go back to your class hit Ctrl + Shift + O

    It will import your missing library:

    import android.support.v4.content.WakefulBroadcastReceiver;
    

    Project > Clean and Voilà !!

提交回复
热议问题