๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
iOS/Issue

[Error] Library not loaded: @rpath no such file

by Callie_ 2023. 11. 13.

โš™๏ธ Setting

- iOS 17 ↑
- Swift vesrion 5.9
- Xcode version 15
 

๐Ÿ’ป Trouble 

- Error Message: "dyld[5106]: library not loaded: @rpath/rxswift.framework/rxswift%0d%0a referenced from: <__________> /private/var/containers/bundle/application/______/name.app/name%0d%0a reason: tried: '/users/callieKim/library/developer/xcode/deriveddata/name-hcxwkdmsuvmqppcfqouwjbvafpio/build/products/debug-iphoneos/packageframeworks/rxswift.framework/rxswift' (no such file), '/private/preboot/cryptexes/os/users/callieKim/library/developer/xcode/deriveddata/name-hcxwkdmsuvmqppcfqouwjbvafpio/build/products/debug-iphoneos/packageframeworks/rxswift.framework/rxswift' (no such file) (....)

 

- This lengthy error message indicated that my project couldn't find the packageFrameworks I had previously imported (Well, definitely RxSwift). The error occurred when I ran the project on an actual device, resulting in a failure to load the app on the phone. The issue stems from the inability to locate the imported packageFrameworks.

 

โœ๏ธTrouble Shooting

 

- Investigated the issue with the keyword  'dyld[5106]: library not loaded: @rpath'

 

 - Many troubleshooting guides suggested checking frameworks, libraries, and embedded content in the general, Target. However, my project did not provide the option to change the status of Embed from None to Embed & Sign. After some research, I found that some issues with this error were resolved by examining the Runpath Search Paths.

 

- I verified my Runpath Search Paths in Build Settings, and the setting message was "$(inherited) @executable_path/Frameworks."

 

- Upon comparison with a reference post, I noticed that it should not include quotation marks and must be written on separate lines between $(inherited) and @executable_path/Frameworks. Following the post's guidance, I corrected the setting, and as a result, I successfully built the project on my device.

 

 

 

 

๐Ÿ“ Reference

 

https://ios-development.tistory.com/1515

 

[iOS - swift] "dyld: Library not loaded @rpath" ์—๋Ÿฌ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• (#framework, #import)

์‚ฌ์ „์ง€์‹) dyld์™€ @rpath dyld: dynamic linker (๋™์  ํ”„๋ ˆ์ž„์›Œํฌ ๋ง์ปค) @rpath: (run search path) ์‹คํ–‰ ์ค‘์ธ ์•ฑ์ด ํŠน์ • ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋‚˜ ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ์ฐพ์„ ๋•Œ ๋™์  ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๊ฒ€์ƒ‰ ๊ฒฝ๋กœ๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ํ† ํฐ ๋™์  ํ”„

ios-development.tistory.com

 

https://sarunw.com/posts/how-to-fix-dyld-library-not-loaded-error/