2025年11月27日年解决隐私清单导致审核总是提示二进制无效的问题

最新新上架一个产品,但是由于有些三方库没有隐私清单的问题导致提交到苹果后台之后总是会提示二进制无效,这里特别说明一下,如果你的app已经是线上的话,貌似没啥问题。(只是问了几个朋友),但是如果你要是新的产品,1.0上线的话那么就会因为这个导致二进制无效无法提交。

提交时后苹果那边给发的邮件内容,有好几个库的警告这里就拿"AFNetworking"举例说明下解决方案。下边是警告:

Please correct the following issues and upload a new binary to App Store Connect. ITMS-91061: Missing privacy manifest - Your app includes "Frameworks/AFNetworking.framework/AFNetworking", which includes AFNetworking, an SDK that was identified in the documentation as a commonly used third-party SDK. If a new app includes a commonly used third-party SDK, or an app update adds a new commonly used third-party SDK, the SDK must include a privacy manifest file. Please contact the provider of the SDK that includes this file to get an updated SDK version with a privacy manifest. For more details about this policy, including a list of SDKs that are required to include signatures and manifests, visit:

解决方案的思路是自己在打包的时候让Trae帮我写了一个脚本然后给指定的库进行了添加。当然网上也有好多其他的解决方案,自己都尝试过了并没有起作用。脚本内容如下:

bash 复制代码
set -euo pipefail
FRAMEWORKS_DIR="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
# 生成标准的 XML plist 隐私清单(不跟踪、不收集、不使用"需要理由"的 API)
write_manifest_basic() {
  dst="$1"
  mkdir -p "$(dirname "$dst")"
  cat > "$dst" <<'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>NSPrivacyTracking</key>
  <false/>
  <key>NSPrivacyCollectedDataTypes</key>
  <array/>
  <key>NSPrivacyTrackingDomains</key>
  <array/>
  <key>NSPrivacyAccessedAPITypes</key>
  <array/>
</dict>
</plist>

PLIST

}


# 给指定 framework 注入隐私清单(若已有则不覆盖)

inject_manifest_basic() {

  fwdir="$1"

  dst="${fwdir}/PrivacyInfo.xcprivacy"

  if [ -f "$dst" ]; then

    echo "Already present: $(basename "$fwdir")/PrivacyInfo.xcprivacy"

  else

    write_manifest_basic "$dst"

    /usr/bin/plutil -lint "$dst"

    echo "Injected PrivacyInfo.xcprivacy into $(basename "$fwdir")"

  fi

}


# 注入后重新签名,避免签名失效

resign_framework() {

  fwdir="$1"

  if [ "${CODE_SIGNING_ALLOWED:-YES}" = "YES" ] && [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" ]; then

    /usr/bin/codesign --force --sign "${EXPANDED_CODE_SIGN_IDENTITY}" --timestamp=none "$fwdir"

    echo "Resigned $(basename "$fwdir")"

  else

    echo "Skip resign: CODE_SIGNING_ALLOWED=${CODE_SIGNING_ALLOWED:-} EXPANDED_CODE_SIGN_IDENTITY=${EXPANDED_CODE_SIGN_IDENTITY:-}"

  fi

}

  


process_framework() {

  name="$1"

  fw="${FRAMEWORKS_DIR}/${name}"

  if [ -d "$fw" ]; then

    inject_manifest_basic "$fw"

    resign_framework "$fw"

  else

    echo "Skip ${name}: not found at ${fw}"

  fi

}

process_framework "AFNetworking.framework"

具体的配置位置如下:

完成上边的配置之后重新打包上传就可以了,如果不放心的小伙伴可以在打包完成之后,导出.ipa的包,然后找到Frameworks这个文件夹,然后在它的下边可以找到AFNetworking.framework的文件夹然后你会看到如下图所示的文件,那么证明你添加成功了。

有了上边的文件之后你再次提交审核就不会出现AFNetworking这个库没有隐私清单的警告了。

相关推荐
sweet丶11 小时前
UIWindowScene 使用指南:掌握 iOS 多窗口架构
ios
崽崽长肉肉15 小时前
swift中的知识总结(一)
ios·swift
2501_9151063218 小时前
HTTP 协议详解,HTTP 协议在真实运行环境中的表现差异
网络·网络协议·http·ios·小程序·uni-app·iphone
柯南二号20 小时前
【大前端】【iOS】iOS 真实项目可落地目录结构方案
前端·ios
2501_9160074720 小时前
iOS与Android符号还原服务统一重构实践总结
android·ios·小程序·重构·uni-app·iphone·webview
二流小码农1 天前
鸿蒙开发:自定义一个圆形动画菜单
android·ios·harmonyos
00后程序员张1 天前
fastlane 结合 appuploader 命令行实现跨平台上传发布 iOS App
android·ios·小程序·https·uni-app·iphone·webview
2501_915106321 天前
iOS 性能优化这件事,结合多工具分析运行期性能问题
android·ios·性能优化·小程序·uni-app·cocoa·iphone
游戏开发爱好者81 天前
App Store 上架流程,结合多工具协作
android·ios·小程序·https·uni-app·iphone·webview
2501_915921431 天前
uni-app 的 iOS 打包与上架流程,多工具协作
android·ios·小程序·uni-app·cocoa·iphone·webview