Flutter 編譯iOS代碼提示錯(cuò)誤 ITMS-91061: Missing privacy manifest ... Toast.framework...

flutter 代碼在提交到App Store 的時(shí)候,收到提示郵件內(nèi)容如下:

ITMS-91061: Missing privacy manifest** - Your app includes “Frameworks/Toast.framework/Toast”, which includes Toast, an SDK that was identified in the documentation as a privacy-impacting third-party SDK. Starting November 12, 2024, if a new app includes a privacy-impacting SDK, or an app update adds a new privacy-impacting 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: https://developer.apple.com/support/third-party-SDK-requirements.

原因

首選需要了解Apple 發(fā)布了第三方SDK 的隱私名單,內(nèi)容如下,如果提示類似上面的內(nèi)容,大概率出錯(cuò)的SDK插件名字就在這個(gè)名單里:https://developer.apple.com/support/third-party-SDK-requirements/

解決方法

如果使用的是 fluttertoast 插件仍然出現(xiàn)這個(gè)錯(cuò)誤,是因?yàn)?fluttertoast 內(nèi)部仍然依賴了 Toast.framework。讓我們來解決這個(gè)問題。

  • 首先,在 iOS 項(xiàng)目目錄下創(chuàng)建一個(gè) PrivacyInfo.xcprivacy 文件:
touch ios/Runner/PrivacyInfo.xcprivacy

在這個(gè)文件中添加如下內(nèi)容:

{
    "NSPrivacyAccessedAPITypes": [
        {
            "NSPrivacyAccessedAPIType": "NSUserDefaults",
            "NSPrivacyAccessedAPITypeReasons": ["FE5F1F"]
        }
    ],
    "NSPrivacyCollectedDataTypes": [],
    "NSPrivacyTrackingDomains": []
}

修改 ios/Podfile,添加 post_install 配置:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    
    # 添加隱私清單文件到所有依賴中
    target.build_configurations.each do |config|
      config.build_settings['PRIVACY_MANIFEST_PATH'] = '${PODS_TARGET_SRCROOT}/PrivacyInfo.xcprivacy'
    end
  end
end

然后重新安裝 pods:

bashCopycd ios
pod deintegrate
rm -rf Pods/
rm -rf .symlinks/
rm -rf Podfile.lock
pod install

上面方法我親測(cè)可用,重新打包上傳到App Store 稍等一會(huì)就沒有收到這個(gè)錯(cuò)誤提示了。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容