http - 如何在 xamarin android 中修复“不允许到 x 的明文 HTTP 流量”
问题描述
我的应用程序 Cleartext HTTP 流量出现问题,不允许发送到 x。
我已经尝试将 android:usesCleartextTraffic="true" 放在我的清单中。但我想将“android:usesCleartextTraffic”标志更改为“false”以防止发送未加密的流量。
如何解决这个问题?
解决方案
你可以用一行代码解决这个问题。在您的 android 项目中的 properties 下打开 AssemblyInfo.cs 并添加以下代码:
[assembly: Application(UsesCleartextTraffic = true)]
推荐阅读
- javascript - 提及后回信
- typescript - 缩写冗长的 TypeScript 类型
- python - “扩展”的列表理解版本
- reactjs - React Redux 将 props 传递给其他组件增强器
- python - 无法使用 jupyter notebook 刷新 Bokeh JS 中的绘图
- java - Eclipse Maven 被阻止
- listview - Flutter:具有不同滚动方向和非固定尺寸的嵌套 ListView?
- string - Bash shell脚本从多行变量返回第一个数字/整数?
- ios - 如何使用经纬度查找 ArcGIS iOS AGSPoint xy 坐标?
- python - 使用 Selenium 循环通过 CSS 选择器时选择器无效或非法