title: Unable to create Session in Quickblox in Android
body: <p>I am new to <code>Quickblox</code>. I am trying to work on <code>webrtc</code>. I followed the tutorial <a href="http://quickblox.com/developers/Sample-webrtc-android#Sources" rel="nofollow noreferrer">here</a>. I have also referred to <a href="https://stackoverflow.com/questions/15282585/quickblox-error-with-custom-object-android">QuickBlox Error with Custom Object (Android)</a>. I am getting the following errors when I try to create a <code>session</code>:</p>
  
  <p><code>Authentication error: Unable to respond to any of these challenges: {}</code></p>
  
  <p><code>D/QBASDK(31816): STATUS : 401</code></p>
  
  <p><code>D/QBASDK(31816): '{"errors":["Unauthorized"]}'</code></p>
  
  <p>My full code is pasted below:</p>
  
  <pre><code>  public class MainActivity extends ActionBarActivity implements OnClickListener,
      QBRTCClientSessionCallbacks, QBRTCClientConnectionCallbacks,
      QBRTCClientVideoTracksCallbacks {
  QBChatService chatService;
  QBUser user1, user2;
  QBGLVideoView localVideoVidew;
  Button btn_session;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      btn_session = (Button) findViewById(R.id.btn_session);
      btn_session.setOnClickListener(MainActivity.this);
  
      /*
       * user1 = new User(1, "User1", "user1", "1234", 1); user2 = new User(2,
       * "User2", "user2", "1234", 2);
       */
      if (!QBChatService.isInitialized()) {
          QBChatService.init(MainActivity.this);
          chatService.getInstance();
      }
  
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
      if (id == R.id.action_settings) {
          return true;
      }
      return super.onOptionsItemSelected(item);
  }
  
  @Override
  public void onClick(View v) {
      // TODO Auto-generated method stub
      switch (v.getId()) {
      case R.id.btn_session:
          create_session();
          // create_SignallingManager();
          break;
  
      default:
          break;
      }
  }
  
  public void create_SignallingManager() {
      // TODO Auto-generated method stub
  
      QBChatService
              .getInstance()
              .getVideoChatWebRTCSignalingManager()
              .addSignalingManagerListener(
                      new QBVideoChatSignalingManagerListener() {
  
                          @Override
                          public void signalingCreated(
                                  QBSignaling qbSignaling, boolean arg1) {
                              // TODO Auto-generated method stub
                              if (!arg1) {
                                  QBRTCClient.getInstance().addSignaling(
                                          (QBWebRTCSignaling) qbSignaling);
                              }
                          }
                      });
      QBRTCClient.getInstance().setCameraErrorHendler(
              new VideoCapturerAndroid.CameraErrorHandler() {
                  @Override
                  public void onCameraError(final String s) {
                      MainActivity.this.runOnUiThread(new Runnable() {
                          @Override
                          public void run() {
                              Toast.makeText(MainActivity.this, s,
                                      Toast.LENGTH_LONG).show();
                          }
                      });
                  }
              });
      QBRTCClient.getInstance()
              .addSessionCallbacksListener(MainActivity.this);
      QBRTCClient.getInstance().addConnectionCallbacksListener(
              MainActivity.this);
      QBRTCClient.getInstance().addVideoTrackCallbacksListener(
              MainActivity.this);
  
      QBRTCClient.getInstance().prepareToProcessCalls(MainActivity.this);
  }
  
  private void create_session() {
      QBSettings.getInstance().fastConfigInit("XXXX", "XXXXXXX", "XXXXX");//Have put ids properly in code
      final QBUser user = new QBUser("user1", "1234");    
      QBAuth.createSession(user, new QBCallback() {
  
          @Override
          public void onComplete(Result arg0, Object arg1) {
              // TODO Auto-generated method stub
              QBUsers.signIn(user,new QBCallback() {
  
                  @Override
                  public void onComplete(Result arg0, Object arg1) {
                      // TODO Auto-generated method stub
  
                  }
  
                  @Override
                  public void onComplete(Result arg0) {
                      // TODO Auto-generated method stub
                      if(arg0.isSuccess())
                      {
                          Log.i("working","fine");
                      }
                  }
              });
  
          }
  
          @Override
          public void onComplete(Result arg0) {
              // TODO Auto-generated method stub
  
          }
      });
  
  
  
  
  }
  
  @Override
  public void onLocalVideoTrackReceive(QBRTCSession arg0,
          QBRTCVideoTrack videoTrack) {
      // TODO Auto-generated method stub
      localVideoVidew = (QBGLVideoView) findViewById(R.id.localVideoView);
      Log.d("TAG", "localVideoVidew is " + localVideoVidew);
      if (localVideoVidew != null) {
          videoTrack.addRenderer(new VideoRenderer(new VideoCallBacks(
                  localVideoVidew, QBGLVideoView.Endpoint.LOCAL)));
          localVideoVidew.setVideoTrack(videoTrack,
                  QBGLVideoView.Endpoint.LOCAL);
          Log.d("TAG", "onLocalVideoTrackReceive() is raned");
      }
  }
  
  @Override
  public void onRemoteVideoTrackReceive(QBRTCSession arg0,
          QBRTCVideoTrack arg1, Integer arg2) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onConnectedToUser(QBRTCSession arg0, Integer arg1) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onConnectionClosedForUser(QBRTCSession arg0, Integer arg1) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onConnectionFailedWithUser(QBRTCSession arg0, Integer arg1) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onDisconnectedFromUser(QBRTCSession arg0, Integer arg1) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onDisconnectedTimeoutFromUser(QBRTCSession arg0, Integer arg1) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onError(QBRTCSession arg0, QBRTCException arg1) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onStartConnectToUser(QBRTCSession arg0, Integer arg1) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onCallRejectByUser(QBRTCSession arg0, Integer arg1,
          Map&lt;String, String&gt; arg2) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onReceiveHangUpFromUser(QBRTCSession arg0, Integer arg1) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onReceiveNewSession(QBRTCSession arg0) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onSessionClosed(QBRTCSession arg0) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onSessionStartClose(QBRTCSession arg0) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onUserNotAnswer(QBRTCSession arg0, Integer arg1) {
      // TODO Auto-generated method stub
  
  }
  </code></pre>
  
  <p>}</p>