GCM : java.lang.noclassdeffounderror: com.google.android.gcm.GCMRegistrar

前端 未结 10 986
深忆病人
深忆病人 2020-12-29 06:50

I am trying to register a device onto GCM using the following code:

    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceSta         


        
相关标签:
10条回答
  • 2020-12-29 07:33

    The SENDER_ID field should be the project ID from when you created your google api project. Read the beginning of this: http://developer.android.com/guide/google/gcm/gs.html#libs

    TAG should also be a string -> ""tag Name"

    0 讨论(0)
  • 2020-12-29 07:38

    I had same problem, after update SDK in my project. it helped for me: I just "add support library" in "Android tools". Hope this helps anyone else.

    0 讨论(0)
  • 2020-12-29 07:39

    Make a folder libs in your project folder and put the gcm.jar in it. Then add it to your class path using add external jars in configure build path option.

    0 讨论(0)
  • 2020-12-29 07:42

    You have to put gcm.jar file inside libs, then go to project Properties > Java Build Path > Libraries and add it to your path using Add External JARs..., after in Order and Export you check gcm.jar and press OK. That should work

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