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

4

错误:

dyld: 库未加载:@executable_path/../Frameworks/n.framework/n 引用自:/Users/hunterp/Library/Developer/CoreSimulator/Devices//data/Containers/Bundle/Application//Demo.app/Demo 原因:找不到图像

我按照这个stackoverflow问题中的每个答案进行了操作:iOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 Beta

以下是我的构建设置: enter image description here

3个回答

4
我猜测你的构建设置中还有其他错误,因为你的错误信息包含了目录之间多余的斜杠。
/Users/hunterp/Library/Developer/CoreSimulator/Devices//data/Containers/Bundle/Application//Demo.app/Demo Reason: image not found
                                                      ^^                                  ^^

(语法高亮很好地指出了当我将其格式化为代码时;))

当搜索框架时,有可能当它向上一个目录(使用..)时,它解析其中一个//,而不是您预期的方式。

我会检查您的头文件、框架和库搜索路径中是否包含不需要的斜杠,特别是如果它们引用$(BUILDDIR)/1或类似的内容。


1.我无法记住实际的环境变量


2
  1. Try to select executable_path and press Delete enter image description here

  2. Also try the same with Library Search Paths and Header Search Paths

  3. If you have 2 targets try to edit your pod file:

    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 Debug和Release配置设置为None enter image description here

为什么第一步应该删除@executable_path?你的意思是Runpath搜索路径应该为空吗? - Ananth Kamath
@AnanthKamath 路径不会为空,它将是默认的。 - ChikabuZ
我忘记在Podfile中设置目标了,谢谢!此外,为了获得更干净的Pod,我建议使用这个被接受的答案:https://dev59.com/BGUp5IYBdhLWcg3w-LUJ#14907073。 - Ahmed

1
我认为错误信息 dyld: Library not loaded: @executable_path/../Frameworks/n.framework/n ... 显示 Runpath Search Paths 被设置为 "@executable_path/../Frameworks"。 前往 "Build Settings" -> "Runpath Search Paths",如果存在则删除 "@executable_path/../Frameworks",然后添加 "@executable_path/Frameworks"。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接