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

前端 未结 10 985
深忆病人
深忆病人 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:16

    Just go to project properties -> java build path -> "order and export " now giv a tick on the jar file "GCM.jar" that you have added

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

    In the updated ADT(Above ADT 17) you have to put jar files inside libs folder and not lib. So make sure that you put gcm.jar file inside libs and not lib folder.

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

    Me also got same problem, after adding android-support-v4.jar and gcm.jar into my libs folder no issues found its work like a charm

    Thanks

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

    Hello You are using old GCM implementations use new implementations available on https://developers.google.com/cloud-messaging/android/start

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

    Make sure that the gcm jar file is in the right libs folder and added into the java build path at your project properties.

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

    My gcm.jar was already in libs, so it wasn't a folder naming issue for me..

    I had to go to Right Click > Build Path > Configure Build path... for the project in question and I removed the following:

    • Any lingering files outside of a folder/bundle
    • Android Private Libraries
    • Any bundles with the word 'reference' in them (you may not have one)

    You might get a lot of "errors" in your project so restart Eclipse and let it clean. Once it cleans you'll have no errors. Run your project and viola.

    Thanks to DLew for this answer.

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