AWS Java NoSuchMethodError 使用 IVONA 文本转语音

AWS Java NoSuchMethodError using IVONA Text to Speech

我已经开始使用 IVONA TTS 并且 AWS 是它的依赖项,所以我也将其导入到项目中。我的问题是,当 运行 即使是示例 Java 应用程序时,我也会收到以下错误:

Exception in thread "main" java.lang.NoSuchMethodError: com.amazonaws.auth.AWS4Signer.presignRequest(Lcom/amazonaws/Request;Lcom/amazonaws/auth/AWSCredentials;Ljava/util/Date;)V
    at com.ivona.services.tts.IvonaSpeechCloudClient.prepareRequest(IvonaSpeechCloudClient.java:292)
    at com.ivona.services.tts.IvonaSpeechCloudClient.prepareRequestForGetUrl(IvonaSpeechCloudClient.java:270)
    at com.ivona.services.tts.IvonaSpeechCloudClient.getCreateSpeechUrl(IvonaSpeechCloudClient.java:159)
    at filetest.TextToSpeech.main(TextToSpeech.java:49)

TextToSpeech.java:49 是:

System.out.println("Requested URL: " + speechCloud.getCreateSpeechUrl(createSpeechRequest));

我使用的是 AWS 版本 1.10.12(最新),但我也尝试了其他几个以前的版本,但都出现了同样的错误。我已经检查了 class 文件 "AWS4Signer",方法 "presignRequest" 确实存在,所以我很困惑为什么会收到此错误。如果需要,here 是我使用的样本。

如果需要,我很乐意添加更多信息。任何帮助将不胜感激。

您的错误是 NoSuchMethod - 我怀疑版本不匹配。从 Ivona 检查您需要使用哪个版本的 AWS。根据 Ivona 的 pom.xml 是 1.9.19.