android - android中配置网络安全xml报错

标签 android xml security networking

android network security docs ,它说要在 res/xml 文件夹中创建一个 network_security_config.xml 文件。

为了在manifest文件中做一个条目,它说要以这种方式做一个条目

<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
    <application android:networkSecurityConfig="@xml/network_security_config"
                    ... >
        ...
    </application>
</manifest>

但我收到错误No resource identifier found for attribute 'networkSecurityConfig' in package 'android'

我还检查了应用程序标记 ( android docs ) 中的有效属性,没有“networksecurityconfig”属性

最佳答案

您需要将 compileSdkVersion 设置为 24 或更高,并将 buildToolsVersion 设置为 24.0.0 或更高。

关于文档,这是一个文档错误。

关于android - android中配置网络安全xml报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41936253/

相关文章:

c# - 从 XDocument 解析 XElement,远低于,重复 3

android - 如何使用默认的 Android 可绘制对象

android - 霍夫圆不检测眼睛虹膜

android - 包含协程延迟时如何对协程进行单元测试?

xml:如何缩进子元素但将属性保留在新行上

java - 自 java 7u45 以来,java "Rich Internet Application"不允许哪些权限?

android - 服务和 Android 应用程序生命周期

.net - 如何正确地将仅包含 "\r\n"的字符串序列化为 XML?

security - 如果 Magento 中的 local.xml 是可公开访问的,会有哪些安全问题?

c# - 以不同用户身份运行外部二进制文件