4

Error:

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

I followed every answer in this stackoverflow question: iOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 Beta

AND heres my build settings: enter image description here

Blazej SLEBODA
  • 8,936
  • 7
  • 53
  • 93
hunterp
  • 15,716
  • 18
  • 63
  • 115

3 Answers3

4

I suspect that there is something else wrong in your build settings as your error message contains extraneous slashes between directories

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

(which the syntax highlighting nicely points out when I format as code ;))

When searching for the framework, it's possible that when it goes up a directory (with ..) it's parsing one of those //s not as you expect.

I'd check your header, framework and library search paths for entries that contain slashes where they are not needed, especially if they reference $(BUILDDIR)/1 or similar


1. I can't remember the actual environment variables

James Webster
  • 31,873
  • 11
  • 70
  • 114
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
    

and run in the terminal : pod update

  1. Also set Pods Debug and Release configuration to None enter image description here
iosMentalist
  • 3,066
  • 1
  • 30
  • 40
ChikabuZ
  • 10,031
  • 5
  • 63
  • 86
  • why should @executable_path be deleted in step one? You mean the Runpath Search path should be empty? – Ananth Kamath Feb 22 '21 at 11:11
  • @AnanthKamath the path will be not empty, it will be default. – ChikabuZ Feb 22 '21 at 11:13
  • I was forgetting the targets in podfile, thanks ! Also for a cleaner pod, I would recommend this accepted answer : https://stackoverflow.com/a/14907073/10202308 – Ahmed Jun 29 '22 at 06:58
1

I think the error

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

shows the Runpath Search Paths is set to be "@executable_path/../Frameworks".
Go to "Build Settings"->"Runpath Search Paths", delete "@executable_path/../Frameworks" if exists, then add "@executable_path/Frameworks".

Mindy
  • 429
  • 4
  • 6