GCMRegistrar cannot be resolved

后端 未结 4 2131
说谎
说谎 2021-01-06 06:40

I\'m trying to implement Push Notification. I have a problem with import com.google.android.gcm.GCMRegistrar it cannot be resolved.

I did install

4条回答
  •  无人及你
    2021-01-06 07:39

    Our Google overlords have decried that gcm.jar is deprecated as of Summer 2013 so whatever example code you're working off that requires GCMRegistrar.java is a bit outdated. Of course, just adding gcm.jar works well as stated in the other answers.

    If you want to follow Google's commands for whatever reason, CommonsWare has an updated GCM example project that basically just copies the needed classes from gcm.jar and renames them with a 'compat' suffix:

    https://github.com/commonsguy/cw-omnibus/tree/master/Push/GCMClient2/src/com/commonsware/android/gcm/client

提交回复
热议问题