Amira Elsayed Ismail
Amira Elsayed Ismail

Reputation: 9404

Authentication information was not properly configured in ibm watson

I am trying to use ibm watson (text to speech) and (speech to text) in my android app

I have the following error

java.lang.IllegalArgumentException: Authentication information was not properly configured.
at com.ibm.cloud.sdk.core.service.BaseService.setAuthentication(BaseService.java:339)
at com.ibm.cloud.sdk.core.service.BaseService.createCall(BaseService.java:201)
at com.ibm.cloud.sdk.core.service.BaseService.createServiceCall(BaseService.java:239)
at com.ibm.watson.text_to_speech.v1.TextToSpeech.listVoices(TextToSpeech.java:146)
at com.ibm.watson.text_to_speech.v1.TextToSpeech.listVoices(TextToSpeech.java:161)
at com.sbs16.ensofia.view.main.MainViewModel$getWatsonVoices$1.invokeSuspend(MainViewModel.kt:131)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:236)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742)

my code is as following, I am getting the authentication token from server and try to use it in authentication

watsonTextToSpeech = com.ibm.watson.text_to_speech.v1.TextToSpeech()

            var headers = HashMap<String, String>()
            headers.put(HttpHeaders.AUTHORIZATION, "Bearer $it")

            watsonTextToSpeech?.let { tts ->
                tts.setDefaultHeaders(headers)

                activity?.let { context ->
                    viewModel.getWatsonVoices(context, tts)
                }
            }

can anyone please advice me what is the problem or what I am missing here ?

Upvotes: 1

Views: 148

Answers (0)

Related Questions