如何在真正的手机上运行应用程序而不是使用模拟器?

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

我是Android应用程序开发的新手,当我尝试运行我的服务器(使用Xampp)时,应用程序在我的模拟器上工作正常,但是在使用(IPv 4)将http://10.0.2.2更改为我的本地IP后,用户注册的应用程序无效尝试在我的真实移动设备(oneplus 6t)上测试它时使用android pie,因为在尝试创建新帐户时会显示此错误:

注册错误! com.android.volley.NoConnectionError:javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorException:找不到证书路径的信任锚。“

我相信这个错误与我的IP地址有关,因为当我尝试使用我的IP打开服务器时,以下警告显示在谷歌浏览器中

“您的连接不是私密的攻击者可能会试图从我的IP地址窃取您的信息(例如,密码,消息或信用卡)。了解更多NET :: ERR_CERT_COMMON_NAME_INVALID”enter image description here

android xampp android-volley ipv6 sslhandshakeexception
2个回答
0
投票

如果您使用的是android 9,则需要安全的https连接,这就是返回给您的错误

你在chrome中遇到了同样的错误


0
投票

试试这个添加清单

cleartextTrafficPermitted = “真”

How to allow all Network connection types HTTP and HTTPS in Android (9) Pie?

© www.soinside.com 2019 - 2024. All rights reserved.