相关疑难解决方法(0)

失败是因为:de.measite.minidns.hla.ResolutionUnsuccessfulException:要求xxxx.在AAAA中产生了错误响应NX_DOMAIN

我将smack升级到4.2.0后,我遇到了连接问题.

The following addresses failed: 'xxxx:5222' failed because: 

de.measite.minidns.hla.ResolutionUnsuccessfulException: Asking for xxxx.    IN  A yielded an error response NX_DOMAIN, '52.90.233.38:5222' failed because: de.measite.minidns.hla.ResolutionUnsuccessfulException: Asking for xxxx. IN  AAAA yielded an error response NX_DOMAIN
Run Code Online (Sandbox Code Playgroud)

在连接配置构建器中设置主机时会发生此问题.

例如:

.setHost(ServiceConstants.CHAT_SERVER)
Run Code Online (Sandbox Code Playgroud)

请参阅https://github.com/igniterealtime/Smack/wiki/Smack-4.2-Readme-and-Upgrade-Guide

这是我的最终配置,它在Davood Falahati帮助之后起作用!

InetAddress inetAddress = InetAddress.getByName(ServiceConstants.CHAT_SERVER);
            XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder()
                    .setXmppDomain(JidCreate.from(ServiceConstants.CHAT_SERVER).asDomainBareJid())
                    .setPort(5222)
                    .setHostAddress(inetAddress)
                    .setDebuggerEnabled(true)
                    .setSendPresence(true)
Run Code Online (Sandbox Code Playgroud)

android xmpp smack

9
推荐指数
1
解决办法
2365
查看次数

标签 统计

android ×1

smack ×1

xmpp ×1