如何修复“没有类型为 Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier 的静态字段实例”?

问题描述 投票:0回答:0

我有一个 Android 应用程序,我正在尝试使用 AWS 的 SNS 服务向其中添加 Google Cloud Messaging 服务。在我开始之前,该应用程序运行良好。然后我添加了这些依赖项:

implementation platform('com.google.firebase:firebase-bom:32.0.0')
implementation 'com.google.firebase:firebase-messaging-ktx'
implementation 'software.amazon.awssdk:sns:+'

我能够编写我需要的代码(遵循已发布的示例)。但是,当我尝试实例化 SnsClient 时,我的应用程序因以下错误而崩溃:

java.lang.NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; in class Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; 

我没有故意尝试使用 org.apache.http 包中的任何类,所以我假设我添加的其他依赖项之一使用它。这意味着我无法通过使用其他一些 http 包来解决问题。

这个问题的根本原因是什么,我该如何解决?

弗兰克

android amazon-sns
© www.soinside.com 2019 - 2024. All rights reserved.