Android 无法使用GCMRegistar?

Android 无法使用GCMRegistar?,android,google-cloud-messaging,Android,Google Cloud Messaging,无法使用gcm.jar中的GCMRegisterar,我已将其添加到构建路径中,但我仍然在logcat中收到此消息 07-12 14:29:08.825: I/dalvikvm(23536): Could not find method com.google.android.gcm.GCMRegistrar.getRegistrationId, referenced from method com.example.registration_id.MainActivity.onCreate 你需

无法使用gcm.jar中的GCMRegisterar,我已将其添加到构建路径中,但我仍然在logcat中收到此消息

07-12 14:29:08.825: I/dalvikvm(23536): Could not find method com.google.android.gcm.GCMRegistrar.getRegistrationId, referenced from method com.example.registration_id.MainActivity.onCreate

你需要创建一个
/libs
文件夹,并将
gcm.jar
复制到其中,然后构建它。

你是如何将jar添加到构建路径的?@darkcrow我将gcm.jar文件从C驱动器中的android文件夹复制到我的eclipse项目中,然后右键单击它并选择buildpath>add to build path。它已添加到我的项目的package Explorer中的引用库中。我不确定是否需要它,但您需要创建一个/libs文件夹,并将gcm.jar复制到该文件夹中,然后构建它。@darkcrow谢谢,您的建议已解决此问题。