2016-02-08 108 views
1

嗨即時通訊使用推送器,經過一些測試後,我一直有麻煩,現在我有這個消息,當我意圖加載任務。pusher-java-client eventQueue在onCreate

02-08 13:43:56.751 20712-21208/package E/AndroidRuntime: FATAL EXCEPTION: pusher-java-client eventQueue 
                     java.lang.NoClassDefFoundError: com.pusher.client.connection.websocket.WebSocketClientWrapper 
                      at com.pusher.client.util.Factory.newWebSocketClientWrapper(Factory.java:67) 
                      at com.pusher.client.connection.websocket.WebSocketConnection$1.run(WebSocketConnection.java:63) 
                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
                      at java.lang.Thread.run(Thread.java:841) 

我這是怎麼調用的onCreate

 runOnUiThread(new Runnable() { 
     @Override 
     public void run() { 

      // Create a new Pusher instance 
      Pusher pusher = new Pusher("KEY"); 

      pusher.connect(new ConnectionEventListener() { 
       @Override 
       public void onConnectionStateChange(ConnectionStateChange change) { 
        System.out.println("State changed to " + change.getCurrentState() + 
          " from " + change.getPreviousState()); 
       } 

       @Override 
       public void onError(String message, String code, Exception e) { 
        System.out.println("There was a problem connecting!"); 
       } 
      }, ConnectionState.ALL); 

      Channel channel = pusher.subscribe("my-channel"); 

      channel.bind("my-event", new SubscriptionEventListener() { 
       @Override 
       public void onEvent(String channel, String event, String data) { 
        System.out.println("Received event with data: " + data); 
       } 
      }); 

      pusher.disconnect(); 

      pusher.connect(); 
      logger.info("Hubo un problema al conectarse"); 

     } 
    }); 
推杆連接

林陷在這裏,我不知道如果IM在一個糟糕的方式實現線程,一些技巧會有所幫助,謝謝!

回答