2

I'm developing an application that use Google messaging. Hence, I need to include the gcm.jar in the final .apk file.

I added the jar file in Eclipse using project properties but still I don't think the file included in .apk file because I'm getting the message:

java.lang.NoClassDefFoundError: com.google.android.gcm.CMRegistrar

Hence, I wonder how to include the jar in .apk file?

user836026
  • 8,705
  • 12
  • 68
  • 119
  • 1
    fyi, if you needed to include classes from an included project as opposed to a whole jar file, you would add the project AND also select it in the order and export tab. It is not enough just to include another project for compilation for it to be in your apk. but I realize in this case you are trying to include the jar. – Code Droid Aug 06 '12 at 22:37

1 Answers1

7

in your project you need create folder "libs", and put into gcm.jar

silentnuke
  • 2,574
  • 1
  • 16
  • 17
  • 1
    Just for clarification, you will need to make sure this "libs" directory is a sibling of your "src" director. i.e. they should be at the same level. This will help you as well: http://stackoverflow.com/questions/2247998/noclassdeffounderror-eclipse-and-android – Swifty McSwifterton Aug 06 '12 at 22:38