首页 > 解决方案 > 为什么我得到一个 ld:framework not foundpod repo推送期间构建错误?

问题描述

我有一个为 iOS 构建的框架,动态框架带有用于 x86_64 (iosSimulator)、arm64 和 arm64e 的通用二进制文件。

当我将它拖到应用程序并使用它时,该框架工作正常。

当我在我的机器上使用包含框架的 repo 和我机器上的另一个 specs repo 时,Pod repo push 工作正常。我使用 git init --bare 创建了存储库

当我使用 github 并将规范指向 github 存储库而不是我的本地存储库时,它会以ld:framework not found <frameworkName>. 当我跳过验证并推送并最终在使用 pod 文件的应用程序中使用它时,我得到相同的错误,ld:framework not found <frameworkName>.

唯一的区别是我已经从保存框架的本地 git 存储库转移到 Github 上的一个。

编辑:

在下面粘贴 podspec

Pod::Spec.new do |s|
    s.name         = "frameworkName"
    s.version      = "0.51.0"
    s.summary      = "A brief description of frameworkName project."
    s.description  = <<-DESC
    An extended description of frameworkName project.
    DESC
    s.homepage     = "http://your.homepage/here"
    s.license = { :type => 'Copyright', :text => <<-LICENSE
                   Copyright 2018
                   Permission is granted to...
                  LICENSE
                }
    s.author             = { "myname" => "" }
    s.source       = { :git => "<git hub repo>", :tag => "#{s.version}", :branch => "iOS_Framework" }

    s.ios.vendored_frameworks = "frameworkName.framework"
    s.vendored_frameworks = "frameworkName.framework"
    s.ios.deployment_target  = '12.0'
    s.pod_target_xcconfig   = { 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
    s.user_target_xcconfig  = { 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
end

标签: iosxcodecocoapodspodspec

解决方案


它最终成为一个区分大小写的问题。repo 上的框架被命名为 frameworkName.Framework 而不是 frameworkName.framework。改了之后就可以用了。

不知道为什么本地 git repo 没有问题。


推荐阅读