为什么连接到可访问的主机时在android9上抛出unknownhostexception?

gj3fmq9x  于 2021-07-03  发布在  Java
关注(0)|答案(0)|浏览(275)

我有一个使用mqtt的应用程序 org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5 通过ssl连接(最新android版本要求使用sha256证书),在android7上运行良好,但应用程序相同 UnknownHostException android 9例外。我的 compileSdkVersion 是30岁。
下面是堆栈跟踪:

2020-12-07 09:48:37.124 21211-21351/pl.app.my W/System.err: MqttException (0) - java.net.UnknownHostException: bialystok.pl
2020-12-07 09:48:37.124 21211-21351/pl.app.my W/System.err:     at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:38)
2020-12-07 09:48:37.125 21211-21351/pl.app.my W/System.err:     at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:738)
2020-12-07 09:48:37.125 21211-21351/pl.app.my W/System.err:     at java.lang.Thread.run(Thread.java:784)
2020-12-07 09:48:37.126 21211-21351/pl.app.my W/System.err: Caused by: java.net.UnknownHostException: bialystok.pl
2020-12-07 09:48:37.126 21211-21351/pl.app.my W/System.err:     at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:209)
2020-12-07 09:48:37.126 21211-21351/pl.app.my W/System.err:     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:436)
2020-12-07 09:48:37.127 21211-21351/pl.app.my W/System.err:     at java.net.Socket.connect(Socket.java:621)
2020-12-07 09:48:37.127 21211-21351/pl.app.my W/System.err:     at com.android.org.conscrypt.ConscryptSocketBase.connect(ConscryptSocketBase.java:152)
2020-12-07 09:48:37.127 21211-21351/pl.app.my W/System.err:     at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:74)
2020-12-07 09:48:37.128 21211-21351/pl.app.my W/System.err:     at org.eclipse.paho.client.mqttv3.internal.SSLNetworkModule.start(SSLNetworkModule.java:132)
2020-12-07 09:48:37.128 21211-21351/pl.app.my W/System.err:     at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:724)
2020-12-07 09:48:37.128 21211-21351/pl.app.my W/System.err:     ... 1 more

原因可能是什么?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题