Programming

dyld : 라이브러리가로드되지 않았습니다 : @ rpath / libswift_stdlib_core.dylib

procodes 2020. 5. 7. 21:27
반응형

dyld : 라이브러리가로드되지 않았습니다 : @ rpath / libswift_stdlib_core.dylib


이전 Xcode 프로젝트에 Swift 클래스를 추가 한 후이 오류가 발생합니다.

dyld: Library not loaded: @rpath/libswift_stdlib_core.dylib

프로젝트를 다시 실행하려면 어떻게해야합니까?


나에게 이전 솔루션 중 어느 것도 효과가 없었습니다. ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES빌드 설정에 YES로 설정해야하는 플래그 (이전 버전 : "내장 된 컨텐츠에 스위프트 코드가 포함됨") 가 있음을 발견했습니다 . 기본적으로 NO였습니다!


이 오류는 Objective-C 프로젝트를 변환하여 Swift 사용을 시작하는 중에 문제가 발생한 경우 발생할 수 있습니다. 문제는 링커 빌드 설정이 제대로 구성되지 않았으므로 직접 수행해야한다는 것입니다. Runpath Search Paths 빌드 설정을 찾아서 다음과 같이 설정하십시오.

$(inherited) @executable_path/Frameworks

여기에 이미지 설명을 입력하십시오

편집 : 또한 다른 문제로 인해이 오류가 최근에 발생했다고 덧붙여 야합니다 .Apple은 아마도 Xcode 6.1 또는 6.1.1에서 시작하여 Swift 자체를 변경했습니다. 유일한 해결책은 Xcode를 종료하고 Keychain Access에서 인증서를 삭제하고 회원 센터로 이동하여 모든 인증서 및 프로필을 삭제 한 다음 (Store의 앱 프로필 제외-삭제할 수 없음) 처음부터 전체 인증서 요청 프로세스


왜이 질문이 다운 투표되는지 확실하지 않습니다. 기존 프로젝트에서 Swift를 처음 사용하려고 할 때도이 문제가 발생했습니다. Xcode를 다시 시작하면이 문제가 해결되었습니다.


이 문제에 대해 오랫동안 검색했습니다. 이 문제의 원인은 여러 가지가 있습니다.

Objectice C 프로젝트에서 Swift 코드 / 라이브러리를 사용할 때 직면하는 경우 솔루션 1-2-3을 시도해야합니다

새로운 Swift 프로젝트 솔루션 4로이 문제에 직면 한 경우 가장 적합합니다.

해결책 1 :

Xcode를 재시작 한 다음 컴퓨터와 iPhone

해결책 2 :

프로젝트 빌드 설정으로 이동하여 Always Embed Swift Standard Libraries(이전 Embedded Content Contains Swift Code) 플래그를YES

해결책 3 :

프로젝트 빌드 설정으로 이동하고 추가 @executable_path/FrameworksRunpath Search Paths옵션

해결책 4 :

위의 방법 중 어느 것도 작동하지 않으면 이것이되어야합니다. AirSign의 게시물에 언급 된 것처럼 Apple은 닌자 패치 인증서 인 것 같습니다.

InHouse 인증서

Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, O=Company Name, C=FR

그들은 OU 라는 새로운 필드를 추가했습니다.

Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, OU=269J2W3P2L, O=Company Name, C=FR

인증서와 프로 비전을 다시 만들어야합니다


필자의 경우 사용자 정의 프레임 워크를 가져 오려고 시도했지만 비슷한 오류가 발생했습니다. 연결된 프레임 워크 및 라이브러리가 아닌 Embedded Binaries에서 프레임 워크를 가져와야합니다.

임베디드 바이너리는 프로젝트 설정->-> 일반에 있습니다.


Adhoc / Enterprise 배포 빌드에서이 문제가 발생한 개발자의 경우,

개발자 포털에서 프로덕션 인증서를 작성한 후 분배 프로파일을 재생성하십시오. 둘 다 Mac에서 다운로드하여 설치하십시오. Xcode 빌드 설정에서 올바른 프로파일을 선택했는지 확인하고 앱을 다시 빌드하십시오.

출처 : https://devforums.apple.com/message/1022908#1022908


해결책 5 :

제 경우에는 accfews 의 답변에 언급 된 모든 솔루션 이 매우 도움이되었지만 아무것도 효과가 없었습니다. 프로젝트 대상의 "일반"섹션에있는 "내장 바이너리"섹션에 빠른 라이브러리를 추가하여 문제를 해결했습니다. 아마도 내 작업 공간에 신속한 프레임 워크를 포함했기 때문일 수 있습니다. 그것이 무엇이든 지금 컴파일! 스위프트 준비해, 내가 왔어!


Xcode를 간단히 다시 시작하면 문제가 해결되었습니다.


저에게있어 문제는 Apple Worldwide Developer Relations Certification Authority가 유효하지 않기 때문입니다.

여기에서 다운로드하십시오 : https://developer.apple.com/certificationauthority/AppleWWDRCA.cer

키 체인 접근으로 드래그 앤 드롭하고 프로젝트를 정리하고 실행하십시오.


위의 모든 답변을 시도했지만 아무것도 효과가 없었습니다.

Finally worked after updating to Yosemite


I had an Obj-C project where I started adding swift source files. The following fixed the issue for me:

  1. Linking: RUNPATH SEARCH PATHS = $(inherited) @executable_path/Frameworks
  2. Swift Compiler - Code Generation: EMBEDDED CONTENT CONTAINS SWIFT = YES

I just created a new project from the templates Xcode 6.3 and compared the project settings with my old original project.


Try to hold Alt, then go to Product -> Clean Build Folder...

Hope it will help someone..


The reasons for this occurring are many. Having just spent a fun weekend finding yet another issue that causes this (the order of code signing), I wanted to create a summary answer that brings all the possible solutions together:

  1. Add Embedded Content Contains Swift Code to project. You need to set this flag if your app contains Swift code.
  2. Clean project. In addition to a Project > Clean you can also delete the DerivedData and Build directories. Look under the Preferences for the location of DerivedData. Build should be in your project folder.
  3. Ensure Runpath Search Paths contains @executable_path/Frameworks.
  4. Ensure that your certificate contains your Apple Team ID in the OU (Organization Unit) field Apple will add this for you, just revoke your existing distribution certificate and create a new one, download, install on KeyChain, regenerate all provisioning profiles, download those and rebuild.
  5. Xcode restart. If everything is basically good, but Xcode hasn't gotten there yet.

That's the easy stuff. If you are doing your own command line build you may be creating your own .ipa files to upload. In that case you need to ensure the following:

  1. Make sure the version of the Swift files in SwiftSupport/iphoneos is the same as the version in Contents/YourApp.app/Frameworks Because Swift is not yet binary compatible between version, you must ensure these versions are the one that you built your app with. You can find these libraries under /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos.
  2. Sign the libraries and frameworks first. You need to codesign the libraries and framework files (under Frameworks in the .app folder) first and then sign the entire .app tree. The .app tree must be signed with an entitlements.plist but not the frameworks.

Hopefully when Swift 3.0 comes out and we no longer need to bundle Swift with our apps this whole issue will go away.


I had this issue using an Ad Hoc (or enterprise) mobileprovision with a production certificate. Switching to a development certificate and mobileprovision solved the issue.


My project is a Swift project with some Objective-C classes. I had the same problem when signed with old inHouse (enterprise) certificate.

The following steps fixed this for me.

  1. Create and use a new certificate and mobile provision.
    (Ref. AIRSIGN’s blog)
  2. Set Runpath Search Paths build setting to: $(inherited) @executable_path/Frameworks.
    (Ref. matt’s answer)

Solution 6:

In our case, the Enterprise Distribution Certificate had been revoked. Generating a new certificate and updating the provisioning profile fixed the issue.

(There seems to be many different causes for this error. Hope this helps someone.)


I have faced the same issue, setting the right code sign identity solved the problem(Build settings->Code Signing Identity).

As per Apple technical question "All Enterprise and standard iOS developer certificates that are created after iOS 8 was released have the new Team ID field in the proper place to allow Swift language apps to run"


If you add the three frameworks via Embedded Binaries, they will be added to Linked Frameworks and Libraries also. Delete the three entries in Linked Frameworks and Libraries will solve the problem.

Magic methods such as relaunch Xcode and restart the Mac doesn't work on me.


Adding Framework as "Embedded Binary" instead of just "Linked Frameworks and Libraries" - Fixed my issue.

I also set Embedded Content Contains Swift Code flag to YES.


Upgrade to Latest Version of OS X (Yosemite)

After hours of trial & error I came to the resolution of this problem. - If this applies to your case of course.

I had the same problem until I upgraded my Mac OS X from Mavericks to Yosemite. - It fixed my problem, hope it fixes yours as well


I tried all the solutions that found on web, including to Apple and new certificates. Without success.

The only way I could run xcode, after 6 months of trying, was creating a new account on my macbook.


Usually this error will disappear if you add this library to the "Copy Files" segment in your Build Phases.


And if all of the above doesn't help you and you really get frustrated... Try the best trick of all: Clean and just to be sure also Clean Build Folder. :) Hope it helps somebody!


None of these solutions seemed to be consistently working for me; after every couple of successful runs, it would fail again. The "Embedded Content Contains Swift Code" flag was always set to YES for me.

Turns out I'd set Xcode to be 6.3-compatible. Changing it back to be 3.2-compatible solved it:


I've had this problem as well, only it wasn't locating libswiftXCTest.dylib.

The solution was to add XCTest.framework to the Tests target, in Build Phases/Link Binary with Library. I was getting this error even when I was trying to build the main target.


This showed up when I added a new Today extension target with Swift language to an old project. Fixed easily by updating the project to recommended settings. Xcode 6.0.1


I got the same issue using Mavericks, Xcode 6.1.1, testing on an iPhone5 with iOS 8.1.1. I tried all possible solution including new certificates and provisioning profiles, but nothing helped. I did the changes to Embedded Content Contains Swift Code and Runpath Search Paths both on Project level and Target level.

I have now installed Yosemite, and without any further changes, it started to work.


Same issue here, for me it was Crashlytics/Fabric/Beta/Twitter/Whatever-they-call-themselves uploading a binary that was missing the embedded frameworks. If I made an archive and then exported an Enterprise build in the standard way, they worked a charm.


My environment: Cocos2d 2.0, Box2d, Objective C

In addition to doing the other answers above I finally went to the General tab and made WatchKit Optional.

대상 : 일반 : 링크 된 프레임 워크 및 라이브러리 : WatchKit.framework : 옵션


After months and months trying everything here... Definition of insanity... starting Xcode under a new Mac user solved it for me.

I removed ~/Library/Developer/* and reinstalled Xcode- so no clue what else to format to make it work.

참고URL : https://stackoverflow.com/questions/24002836/dyld-library-not-loaded-rpath-libswift-stdlib-core-dylib

반응형