Anroid Studio警告"设置< base-config cleartextTrafficPermitted ="true"/>.不推荐." [英] Anroid Studio warning " Setting <base-config cleartextTrafficPermitted="true"/> is not recommended."

查看:2092
本文介绍了Anroid Studio警告"设置< base-config cleartextTrafficPermitted ="true"/>.不推荐."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将payUmoney与我的应用程序集成.对于高于9的android,默认情况下为cleartextTrafficPermitted ="false".所以我收到以下错误-

I am integrating payUmoney with my app. For android above 9 cleartextTrafficPermitted="false" by default. So I get the following error -

The webpage at hhtp://180.179.174.15:3000/pgSimulator/axis/redirect could not be loaded because: net::ERR_CLEARTEXT_NOT_PERMITTED

因此,在network_secrity_config.xml中,我将其更改为true,如下所示-

So in network_secrity_config.xml, I change it to true as below--

  <?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true"/>
</network-security-config>

现在Android Studio展示了

And now Android studio shows

     Setting  <base-config cleartextTrafficPermitted="true"/> is not recommended. 

现在将其设置为false是安全的吗?如果我不将其设置为false. PayUmoney不起作用.那现在该怎么办?

Now is it safe to set it to false? If I don't set it to false. PayUmoney does not work. So what to do now?

推荐答案

可以使用

<application
    ...
    android:usesCleartextTraffic="true">
    ....
</application>

或使用域如下设置配置:

Or set config like below with domain:

<network-security-config>
  <domain-config cleartextTrafficPermitted="true">
    <domain includeSubdomains="true">Your_domain</domain>
  </domain-config>
</network-security-config>

这篇关于Anroid Studio警告&quot;设置&lt; base-config cleartextTrafficPermitted ="true"/&gt;.不推荐."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆