You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

添加隐私清单后,.NET MAUI iOS应用仍遭苹果API声明缺失警告

问题原因及解决办法

核心问题:隐私清单结构错误

你的PrivacyInfo.xcprivacy文件格式不符合苹果官方要求,plist根节点下直接放置多个<dict>元素是无效的。正确的结构应该是在根<dict>中添加NSPrivacyAccessedAPITypes作为key,其对应的值是包含所有API声明<dict>的数组。

修正后的隐私清单内容

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NSPrivacyAccessedAPITypes</key>
    <array>
        <dict>
            <key>NSPrivacyAccessedAPIType</key>
            <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
            <key>NSPrivacyAccessedAPITypeReasons</key>
            <array>
                <string>C617.1</string>
            </array>
        </dict>
        <dict>
            <key>NSPrivacyAccessedAPIType</key>
            <string>NSPrivacyAccessedAPICategorySystemBootTime</string>
            <key>NSPrivacyAccessedAPITypeReasons</key>
            <array>
                <string>35F9.1</string>
            </array>
        </dict>
        <dict>
            <key>NSPrivacyAccessedAPIType</key>
            <string>NSPrivacyAccessedAPICategoryDiskSpace</string>
            <key>NSPrivacyAccessedAPITypeReasons</key>
            <array>
                <string>E174.1</string>
            </array>
        </dict>
    </array>
</dict>
</plist>

额外检查项

  • 确认PrivacyInfo.xcprivacy的Build Action确实设置为BundleResource,右键文件→属性可查看修改
  • 执行清理操作(Visual Studio:项目→清理)后,重新构建并打包IPA,避免缓存旧文件
  • 检查项目依赖的第三方NuGet包:如果依赖库调用了这些API,也需要在它们的隐私清单中声明,或联系包作者更新
  • 验证提交的IPA是最新构建版本:可以通过查看IPA包内的PrivacyInfo.xcprivacy是否存在且内容正确来确认

内容的提问来源于stack exchange,提问作者MisterAcoustic

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.25 23:42:32