在android中无法连接到/ local ip地址

在android代码中,我使用了本地IP地址。但是运行代码后,在我的设备中,本地IP地址未连接。它显示类似错误

failed to connect to /aaa.bbb.c.xx7 (port 8085) from /aaa.bbb.c.xx6 (port 47380) after 10000ms

在我的设备中IP地址显示为 aaa.bbb.c.xx6 ,但在我的系统IP地址中显示为 aaa.bbb。 c.xx7

我找不到问题所在?

我可以更改任何改装设置吗?

a349158555 回答:在android中无法连接到/ local ip地址

看起来您在应用中使用了保护规则。将这些行添加到您的proguard-rules.pro文件中(或者如果您使用的是custom-rules.pro文件)来解决此问题。

-dontnote retrofit2.Platform
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions

-dontwarn com.squareup.okhttp3.**

-dontwarn okio.**

Proguard规则文件路径<project_root>\app\proguard-rules.pro

有关更多信息,请参阅此翻新的正式Proguard规则file

本文链接:https://www.f2er.com/3159685.html

大家都在问