Program Tip

dyld : 라이브러리가로드되지 않음 : @ rpath / libswiftCore.dylib / 이미지를 찾을 수 없음

programtip 2020. 10. 22. 22:23
반응형

dyld : 라이브러리가로드되지 않음 : @ rpath / libswiftCore.dylib / 이미지를 찾을 수 없음


xcode에서 iOS 기기로 앱을 실행하고 있는데 iOS 기기에서이 화면과 검은 색 화면이 나타납니다.

콘솔 텍스트 :

dyld: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /private/var/mobile/Containers/Bundle/Application/10DB2FE8-EF09-4857-B4AC-0DB2E4419D6F/App-Name.app/App-Name           
Reason: image not found        
(lldb)

스크린 샷 추가


대상의 Runpath 검색 경로다음 줄을 추가하십시오 .

@executable_path/Frameworks

your_target- > 빌드 설정-> 연결-> Runpath 검색 경로


나는 이와 같은 문제가 있었다. 결국 다음 위치에 프레임 워크를 추가했습니다.

  1. General > Embedded Binaries
  2. General > Linked Frameworks and Libraries
  3. Build Phases > Link Binaries with Libraries

포함 된 바이너리는 저를위한 열쇠가 될 것 같았다.


나를 위해 대상이 아닌 Runpath Search Paths 프로젝트에 추가 @executable_path/Frameworks하는 데 도움이됩니다 . your_project-> 빌드 설정-> 연결-> Runpath 검색 경로여기에 이미지 설명 입력


다른 솔루션은 나에게 도움이되지 않았지만 Xcode의 Derived Data 디렉토리를 삭제하여 모든 것이 해결되었습니다 .


어 그래. 나는 해결책에 시간을 소비하는 그 문제에 직면했습니다. Build Settings> Build Options에서 "Always Embed Swift Standard Libraries"를 "Yes"로 설정할 수 있습니다.

dyld : 라이브러리가로드되지 않음 : @ rpath / libswiftCore.dylib

(다음에 프로젝트를 shift + cmd + K하는 것을 잊지 마십시오)


Obj-C 임베디드 프레임 워크를 Swift 개체로 업데이트 한 후 Obj-C 앱이 작동하도록하려면 'Embedded Content Contains Swift Code'를 'Yes'로 전환해야했습니다.


Framework Target ( app target 아님)에서 Build Settings> Build Options> Always Embed Standard Swift Libraries to YES로 이동합니다.

이것은 나를 위해 문제를 해결했습니다!


명령 줄 프로젝트 (Xcode 10.2 및 macOS 10.14.3)에서이 오류가 발생했습니다.

해결책은 macOS 10.14.4업데이트하는 것이 었습니다.

명령 줄 도구 패키지에 대한 Swift 5 런타임 지원을 설치하지 않으면 macOS 10.14.3 및 이전 버전에서 Swift 명령 줄 프로젝트가 실행되지 않습니다. 해당 패키지가 없으면 Swift 명령 줄 프로젝트가 시작시 "dyld : Library not loaded"오류와 함께 충돌합니다. (46824656)

에서 스위프트 5 릴리스 노트 엑스 코드 10.2


Xcode Derived Data 디렉토리에서 모두 삭제하여 수정했습니다.

~ / Library / Developer / Xcode / DerivedData

모두 행운을 빕니다!


동일한 문제에 직면하여 올바른 코드 기호 ID를 설정하면 문제가 해결되었습니다 (빌드 설정-> 코드 서명 ID).

Apple 기술 질문에 따르면 "iOS 8이 출시 된 후 생성 된 모든 엔터프라이즈 및 표준 iOS 개발자 인증서에는 Swift 언어 앱을 실행할 수 있도록 적절한 위치에 새로운 팀 ID 필드가 있습니다."


제 경우에는 Swift 프레임 워크 (AirWatch SDK)를 사용하는 Objective-c 프로젝트에서이 문제가 발생합니다.

해결책 : 아래 단계에서 언급 한대로 Xcode 9.3 및 11.0.1 iOS에서이 문제를 해결했습니다.

  1. 신속한 프레임 워크를 프로젝트에 끌어다 놓고 프로젝트의 기본 프레임 워크 폴더로 이동합니다.
  2. 그런 다음 스크린 샷과 같이 포함 된 바이너리로 추가합니다.
  3. 스크린 샷에 표시된대로 프레임 워크 상태를 필수 에서 선택 으로 변경합니다 . (빌드 단계> 라이브러리와 바이너리 연결)

여기에 이미지 설명 입력

  1. Set Always Embed Swift Standard Libraries to Yes in your build settings.

  2. Set Subpath and select destination as Framework for your added framework in Build Phases> Embed frameworks as shown in screenshot. 여기에 이미지 설명 입력

Hope it will help someone.


I had the same error message, that is how I solved it :

The issue came from the certificates generated automatically by Xcode. I had to revoke these certificates dans generate them back from developer.apple.com

The solution is then : - Go to developer.apple.com / certificates --> Revoke certificates OR go in Xcode > preferences > accounts > View details > select Sigining identities > clic setting whell > revoke - Got to developper.apple.com and follow instructions to generate new certificates - In Xcode in my project : go to Code Signing Identity and sign both Debug lines with the generated certificate - Both release lines are set to "iOS Developer" - Then project > clean - Build and run on device


@Saikiran's answered worked.

My certificates were generated before iOS 8 was released. I revoked all my certificates and regenerated all provisioning profiles and it solved my problems immediately.

I don't have enough reputation to vote up @Saikiran's answer, but that definitely helped solving the problem.


This error message can also occur when using a framework build in a different Swift version then the one currently being used, e.g. if you upgrade Xcode.


For me has worked set the option

ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES

to YES in Project -> Build Settings -> Build Options

(Namirial framework through Cocoapods)


None of the above solutions worked for me. I changed the iPhone Developer Certificate trust settings in Keychain. It should be Always Trust. Change it to Use System Defaults. Double click the certificate in Keychain to open the option screen Discovered that from this blog


I had the same error message, this is how I solved it : This is happening because i changed bundle identifier, so i just put old bundle id and it started to work again


I already had the Runpath Search Paths set correctly, but it still didn't work. @Justin Domnitz's answer put me on the right track: Setting "Always Embed Swift Standard Libraries" to Yes in my target's build settings did the trick for me.


Seems this issue was caused by the inclusion of Swift file into objective-c custom framework. Also unsure if related but my app target was built in objective-c as well. Also building to simulator in debug. Haven't verified for release or archive build yet.
Additionally Runpath Search Settings for the project target were set to "@executable_path/Frameworks", within the target settings for the framework they were set to: "@executable_path/Frameworks" and "@loader_path/Frameworks".

After having tried rebuilding custom framework and reattaching to app target, clearing derived data folder and a couple other suggestions, what ultimately worked for me was changing the build setting within Project target for the custom framework project (not app target): "Always Embed Swift Standard Libraries" to "YES". It appeared not to matter what the setting for the app target was set to. I verified this by resetting the simulator and rebuilding. This is similar to Daniele Ceglia's answer but I wasn't able to add a comment and wanted to provide more clarity.


For me Cleaning the project solve the issue!


I got such issue, too All other ways could not help me, so I have done it on stupid way created new project and pod install from scratch and after confirmed it is working correctly, I copied all class files and storyboard files, at last done! I think it is the last way for it, maybe could help you


I had a similar problem in an Objective-C project where I started to include Swift files.

In my case, I created two targets in the main project, and I added a Swift empty file, that creates a bridging header file and some configurations, but I only marked it as a member of one target. The first target works properly, but the second not, and I noticed that the differences in build settings were this setting:

Runpath Search Paths -> $(inherited) and @executable_path/Frameworks

And I also needed to reference Objective-C Bridging Header to the file that was created before:

Objective-C Bridging Header -> pathTo/Target-Bridging-Header.h

After adding this two settings, the second target started to work properly.


Try cleaning the build folder, I was having the same problem and I solved it this way: Product -> Clean Build Folder


For Me restart simulator solved this problem.


I tried a bunch of the cases above and it didn't seem to solve my issue. I use git and cocoapods for a project, and the error went away as soon as I made a new commit.


I had this problem before in iPod touch iOS 9.3. And I used all the methods mentioned in this post, but none of them worked. I checked my project setting. And in the other link flag, I found I added -Wl,-sectcreate,__RESTRICT,__restrict,/dev/null.

이 플래그는 탈옥 된 전화에 dyld 삽입을 방지합니다. 이 플래그를 삭제하면 앱을 다시 시작할 수 있습니다. 왜 효과가 있었는지 모르겠습니다. iPhone se iOS 10에서는이 줄을 삭제할 필요가 없기 때문입니다. 그러나 그것은 iPod touch iOS 9.3에서 작동했습니다. 그러니 나와 같은 상황이라면 확인해보세요.


* .framework _CodeSignature 서명 프레임 워크 디렉토리가있는 경우 확인하십시오. _CodeSignature 폴더가 없으면 빌드 단계로 이동하고 +를 클릭하여 새 파일 복사 단계를 추가하여 파일 복사를 만듭니다. 그런 다음 * .framework를 참조하고 Code Sign On Copy를 선택합니다.

참고 URL : https://stackoverflow.com/questions/26104975/dyld-library-not-loaded-rpath-libswiftcore-dylib-image-not-found

반응형