2012-07-12 28 views
3

不能使用gcm.jar中的GCMRegisterar,我已經添加到構建路徑,但仍然在logcat中獲取此消息。不能使用GCMRegistrar?

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 
+0

如何將jar添加到構建路徑? – 2012-07-12 10:00:55

+0

@darkcrow我將C盤中android文件夾中的gcm.jar文件複製到我的eclipse項目中,然後右鍵單擊它並選擇構建路徑>添加構建路徑。它被添加到我的項目的package explorer中的引用庫中。 – Rishikesh 2012-07-12 12:01:44

+0

我不小心,如果它需要,但你需要創建一個/ libs文件夾,並將gcm.jar複製到,然後構建它。 – 2012-07-12 12:35:56

回答

4

你需要創建一個/libs文件夾,複製gcm.jar成,然後建立它。