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
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
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.
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:
Here 's a screenshot
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à !!
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..
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`
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.