【问题标题】:Unable to archive build with Share Extension and AFNetworking Cocoapod无法使用 Share Extension 和 AFNetworking Cocoapod 归档构建
【发布时间】:2015-05-20 02:25:59
【问题描述】:

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

链接到 dylib 对于在应用程序扩展中使用不安全 AFNetworking

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

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

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

我查看了Apple Guidelines 并使用了 arm64 架构,并将目标的“仅需要应用程序扩展安全 API”构建设置设置为是。

【问题讨论】:

    标签: ios afnetworking cocoapods ios-app-extension


    【解决方案1】:

    据我所知,如果 pod 库正确链接到扩展目标(检查目标),最新版本的 cocoapods 应该自动为所有库目标设置“仅允许应用扩展 API”标志(检查目标来自 Pods.xcodeproj)。如果没有发生,您可以尝试在 post_install 挂钩中手动设置它。你可以试试这个:

    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
    

    【讨论】:

    • 有没有办法仅针对扩展目标执行此操作?我的应用本身需要引用 UIApplication…
    • #<:installer:0x00007fca9c3a0d40> 的未定义方法 `project'
    猜你喜欢
    • 1970-01-01
    • 2015-05-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-05
    • 1970-01-01
    • 2015-08-18
    • 1970-01-01
    相关资源
    最近更新 更多