title: IBM Watson UnAuthorized
body: <p>I implemented IBM watson Assistant and it works perfectly fine on android debug. Problem comes when I build a signed apk. It always says Unauthorized. I don't think its the key because its working fine on debug mode. I need some help because the project is live.
  What I have tried so far is to change the key in IBM cloud and tried other keys but it raises not found exception of which i think is caused by wrong key. Im I supposed to allow something in IBM cloud for signed apk? or is there a certificate from signed apk that I have to upload in IBM cloud?
  Im using IBM watson Assistant v2</p>
  
  <pre><code>private Assistant watsonAssistant;
  private Response&lt;SessionResponse&gt; watsonAssistantSession;
  
  private void createServices() {
      watsonAssistant = new Assistant("2020-04-01", new IamAuthenticator(getString(R.string.assistant_apikey)));
      watsonAssistant.setServiceUrl(getString(R.string.assistant_url));
  }
  
  private void sendMessage(){
      Thread thread = new Thread(() -&gt; {
                      try {
                          if (watsonAssistantSession == null) {
                              ServiceCall&lt;SessionResponse&gt; call = watsonAssistant.createSession(new CreateSessionOptions.Builder().assistantId(getString(R.string.normal_assistant_id)).build());
                              watsonAssistantSession = call.execute();
                          }
                          MessageInput input = new MessageInput.Builder()
                                  .text(userInput)
                                  .build();
                          MessageOptions options = new MessageOptions.Builder()
                                  .assistantId(getString(R.string.normal_assistant_id))
                                  .input(input)
                                  .sessionId(watsonAssistantSession.getResult().getSessionId())
                                  .build();
                          Response&lt;MessageResponse&gt; response = watsonAssistant.message(options).execute();
                          if (response.getResult().getOutput() != null &amp;&amp; !response.getResult().getOutput().getGeneric().isEmpty()) {
                              List&lt;RuntimeResponseGeneric&gt; responses = response.getResult().getOutput().getGeneric();
                              for (RuntimeResponseGeneric r : responses) {
                                  switch (r.responseType()) {
                                      case "text":
                                          aiResponse = r.text();
                                          aiConversationList.add(new AIConversation(r.text(), "ai", System.currentTimeMillis()));
                                          break;
                                      default:
                                          Log.e("Error", "Unhandled message type");
                                  }
                              }
                              runOnUiThread(() -&gt; {
                                  sendConvoToServer(userInput, aiResponse);
                                  txtWelcomeAI.setVisibility(View.VISIBLE);
                                  aiAdapter.notifyItemInserted(aiConversationList.size() - 1);
                                  userInputTxt.setEnabled(true);
                                  pRecyclerView.scrollToPosition(aiConversationList.size() - 1);
                                  aStatus.setText("online");
  
                              });
                          }
                      } catch (Exception e) {
                          e.printStackTrace();
                          Log.e("IBM_EXCEPTION", e.toString());
                          aiConversationList.add(new AIConversation("Oops! Something went wrong", "ai", System.currentTimeMillis()));
                          aiAdapter.notifyItemInserted(aiConversationList.size() - 1);
                          runOnUiThread(() -&gt; {
                              pRecyclerView.scrollToPosition(aiConversationList.size() - 1);
                              aStatus.setText("online");
                              userInputTxt.setEnabled(true);
                          });
                      }
                  });
                  thread.start();
  }
  </code></pre>