android - 如何为小于 24 的 API 添加 Android 网络安全配置

标签 android facebook-audience-network

Facebook Audience Network声明。

In the Audience Network Android SDK, we use 127.0.0.1 (localhost) as a caching proxy to cache media files in the SDK. Since Android P, cleartext traffic (unencrypted HTTP) will be blocked by default, which will affect the functionality of media caching of the SDK and could affect user experience and ads revenue.

现在,如果我尝试在我的 AndroidManifest 中添加此行 android:networkSecurityConfig="@xml/network_security_config" 我会收到警告,即 API 24 中使用了属性 networkSecurityConfig以及更高版本,因为我的应用支持 minSdkVersion 15

我应该如何添加 android:networkSecurityConfig 才不会影响小于 24 的 API

最佳答案

默认情况下它是这样工作的。旧设备无法识别 android:networkSecurityConfig,因为它在 API 级别 24 (Android 7.0) 之前不存在。

关于android - 如何为小于 24 的 API 添加 Android 网络安全配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52691058/

相关文章:

android - 如何连接webviewclient和Chromeweb View 客户端

java - 我的 BroadcastReceiver 上没有收到操作 - Android Studio

php - 使用 Volley 从 Android 发送数组并在 PhP 服务器接收

android - java.util.zip.ZipException : duplicate entry: com/facebook/ads/AbstractAdListener. 类

android - 如何使用事件 URI 以编程方式向日历事件添加提醒?

java - 为给定值定义回调函数

android - 由于 audience-network.dex 文件,APK 大小增加

android - 如何解决导致版本更新的 Facebook Audience 网络错误?

android - 如何解决 Android 应用程序受众网络中的质量检查问题?

android - 错误膨胀类 com.facebook.ads.MediaView