gpt4 book ai didi

ios - 无法使用 Share Extension 和 AFNetworking Cocoapod 存档构建

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:49:03 24 4
gpt4 key购买 nike

我已经为我的应用程序设置了共享扩展,并且我正在通过 cocoapods 安装使用 AFNetworking。
我能够通过模拟器构建和运行应用程序,通过调试构建我的手机,但是当我尝试存档以提交到应用程序商店时,我遇到了警告:

linking against dylib not safe for use in application extensions AFNetworking

存档构建会完成,但它们会损坏且无法使用。

我的解决方案是停止将 cocoapods 用于我的应用程序扩展,并手动将 AFNetworking 文件添加到我的编译资源build设置中。

我只是想知道其他人是否遇到过这个问题,或者他们使用 AFNetworking cocoapod 向商店提交扩展是否没有问题。

我已经检查了 Apple Guidelines并且正在使用 arm64 架构并将目标的“仅需要 App-Extension-Safe API”build设置设置为是。

最佳答案

据我所知,如果 pods 库正确链接到扩展目标,最新版本的 cocoapods 应该自动设置“Allow app extension API only”标志来自 Pods.xcodeproj)。如果没有发生,您可以尝试在 post_install Hook 中手动设置它。你可以试试这个:

post_install do |installer_representation|
installer_representation.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'YES'
end
end
end

关于ios - 无法使用 Share Extension 和 AFNetworking Cocoapod 存档构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29102814/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com