WakefulBroadcastReceiver cannot be resolved to a type

前端 未结 8 1211
日久生厌
日久生厌 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:02

    Get the latest version of the support file. If you are using Eclipse, start the Android SDK manager (Window->Android SDK Manager). Under Extras->Android Support Library you will see if you have the latest revision (if not it will say update available). After updating the package should appear here: /extras/android/support/.

    More info: http://developer.android.com/tools/support-library/setup.html

    0 讨论(0)
  • 2021-01-01 18:07

    I have the same problem. I have updated 'Android support library' via Android SDK Manager but still cannot find WakefulBroadcastReceiver.

    The solution is you have to delete 'Android support library' in Android SDK Manager and re-install it!

    I have to say developing for Android is not delighting. Google deprecated c2dm and com.google.android.gcm.GCMBaseIntentService so that all tutorials about android push notification become obsolete.

    0 讨论(0)
  • 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à !!

    0 讨论(0)
  • 2021-01-01 18:12

    It's because of android-support-v4.jar file, make sure you have the latest. If you think you have it in your project just do a trick. Find same file in another project, say create new project with latest SDK. Copy it's jar file into your this project and replace the older one. Now import import android.support.v4.content.WakefulBroadcastReceiver; and see it working..

    0 讨论(0)
  • 2021-01-01 18:14

    It works for me Add v-13 jar file `Go to\projects\properties\java built path\add external jar

    And your jar file location is sdk\extras\android\support\v-13`

    0 讨论(0)
  • 2021-01-01 18:15

    The above answer didn't worked for so the below procedure fixed my issue.

    IF none of the answers are working set your target to Properties->Android->Under Project build target Select the goolgle API's ->Apply -> OK

    This is obvious in case you missed to set Google API as your target.

    0 讨论(0)
提交回复
热议问题