3 Replies
      Latest reply on Oct 17, 2019 2:43 AM by ravikavisisodia
      Devendra smartData Level 1 Level 1 (0 points)

        I using below code on button press in watch app to speak a text.

        let utterance = AVSpeechUtterance(string: "Hello world")

                utterance.voice = AVSpeechSynthesisVoice(language: "en-GB")

         

                let synthesizer = AVSpeechSynthesizer()

                synthesizer.speak(utterance)

        But it crash with below error "Terminating app due to uncaught exception 'NSRangeException', reason: 'Cannot remove an observer <AXSpeechManager 0x800b2c00> for the key path "audioSessionCategory" from <AXSpeechManager 0x800b2c00> because it is not registered as an observer."
        Above code is working on xcode 11. but due to problem in updating title in didapper in watch when more that one page are in rootpagecontroller I swiched to 11.2 beta . But now it is giving above crash.