dyld:未加载库:@executable_path/../Frameworks/

dyld: Library not loaded: @executable_path/../Frameworks/

错误:

dyld: Library not loaded: @executable_path/../Frameworks/n.framework/n Referenced from: /Users/hunterp/Library/Developer/CoreSimulator/Devices//data/Containers/Bundle/Application//Demo.app/Demo Reason: image not found

我遵循了这个 Whosebug 问题中的每个答案:iOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 Beta

这是我的构建设置:

我怀疑您的构建设置中还有其他问题,因为您的错误消息在目录之间包含多余的斜杠

/Users/hunterp/Library/Developer/CoreSimulator/Devices//data/Containers/Bundle/Application//Demo.app/Demo Reason: image not found
                                                      ^^                                  ^^

(当我格式化为代码时,突出显示的语法很好地指出了这一点;))

在搜索框架时,当它进入一个目录(带有 ..)时,它可能正在解析其中一个 // 与您预期的不同。

我会检查您的 header、框架和库搜索路径,查找在不需要的地方包含斜线的条目,尤其是当它们引用 $(BUILDDIR)/1[=26 时=] 或类似的


1.我不记得实际的环境变量

我认为错误

dyld: Library not loaded: @executable_path/../Frameworks/n.framework/n ...

显示运行路径搜索路径设置为“@executable_path/../Frameworks”。
转到 "Build Settings"->"Runpath Search Paths",删除“@executable_path/../Frameworks”(如果存在),然后添加“@executable_path/Frameworks”。

  1. 尝试selectexecutable_path然后按删除

  2. 也尝试使用库搜索路径和 Header 搜索路径

  3. 如果您有 2 个目标,请尝试编辑您的 pod 文件:

    target :MainTarget, :exclusive => true do
    link_with ['Target1']
    
      pod 'SomePod'
    
    end
    
    target :SecondTarget, :exclusive => true do
    link_with ['Target2']
    
      pod 'SomePod'
    
    end
    

和 运行 在终端中:pod update

  1. 同时将 Pods 调试和发布配置设置为 None