PushBots崩溃:NullpointerException

时间:2014-03-20 20:57:48

标签: android nullpointerexception push

我使用PushBots收到以下错误。但是,当应用程序运行时,它可以正常工作。

03-20 15:35:45.628: V/PBGCMBaseIntentService(23720): Acquiring wakelock
03-20 15:35:45.648: I/PBGCMIntentService(23720): Received a Notification.
03-20 15:35:45.648: V/PBGCMBaseIntentService(23720): Releasing wakelock
03-20 15:35:45.648: W/dalvikvm(23720): threadid=11: thread exiting with uncaught exception (group=0x41ccc700)
03-20 15:35:45.653: E/AndroidRuntime(23720): FATAL EXCEPTION: IntentService[GCMIntentService--1]
03-20 15:35:45.653: E/AndroidRuntime(23720): java.lang.NullPointerException
03-20 15:35:45.653: E/AndroidRuntime(23720):    at com.pushbots.push.Pushbots.regID(Pushbots.java:409)
03-20 15:35:45.653: E/AndroidRuntime(23720):    at com.pushbots.push.Pushbots.sendStatsToServer(Pushbots.java:282)
03-20 15:35:45.653: E/AndroidRuntime(23720):    at com.pushbots.push.GCMIntentService.onMessage(GCMIntentService.java:112)
03-20 15:35:45.653: E/AndroidRuntime(23720):    at com.google.android.gcm.GCMBaseIntentService.onHandleIntent(GCMBaseIntentService.java:191)
03-20 15:35:45.653: E/AndroidRuntime(23720):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
03-20 15:35:45.653: E/AndroidRuntime(23720):    at android.os.Handler.dispatchMessage(Handler.java:99)
03-20 15:35:45.653: E/AndroidRuntime(23720):    at android.os.Looper.loop(Looper.java:176)
03-20 15:35:45.653: E/AndroidRuntime(23720):    at android.os.HandlerThread.run(HandlerThread.java:61)

以下是我的主要活动的片段

public class MainActivity extends FragmentActivity implements
        ActionBar.OnNavigationListener {

    /**
     * The serialization (saved instance state) Bundle key representing the
     * current dropdown position.
     */
    private static final String STATE_SELECTED_NAVIGATION_ITEM = "selected_navigation_item";
    private String SENDER_ID = "xxxxxxxxxx";
    private String PUSHBOTS_APPLICATION_ID = "xxxxxxxxxxxxxxxxx";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        setContentView(R.layout.activity_main);
        Pushbots.init(this, SENDER_ID,PUSHBOTS_APPLICATION_ID);

0 个答案:

没有答案