Xcode 7.0 XCTest dyld: could not load inserted library IDEBundleInjection - ios

I'm running unit tests on my iOS project and when it's running, it crashes and spits this out:
dyld: could not load inserted library '/private/var/mobile/Containers/Data/Application/1CAB64C8-D730-427B-8E9E-BD5E152ACFD6/tmp/IDEBundleInjection.framework/IDEBundleInjection' because no suitable image found. Did find:
/private/var/mobile/Containers/Data/Application/1CAB64C8-D730-427B-8E9E-BD5E152ACFD6/tmp/IDEBundleInjection.framework/IDEBundleInjection: mmap() error 1 at address=0x00436000, size=0x00004000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Data/Application/1CAB64C8-D730-427B-8E9E-BD5E152ACFD6/tmp/IDEBundleInjection.framework/IDEBundleInjection
I'm using XCode 7.0 and testing on an iPod running iOS 8.3. I have deleted the derived data and I've restarted XCode and it still hasn't worked.

I fixed this by just creating a new UnitTest target, copying everything over, and removing the old one.

In General Panel , not leave the Team to "None"
At Same time : select the code sign in Build Setting->Code Signing-> Code Signing Identity

I managed to fix this by specifying my developer certificate in build settings->code signing identity.

I fixed this by selecting the correct target and then selecting the correct Code Signing Identity from Settings. It was set to a non default - changed to 'IOS Developer' for the Debug setting entry.

In my case there was nothing wrong with the provisioning profiles, it was down to the Architectures in the project excluding arm64. Once arm64 was added to both the test target and the host app target the tests ran fine (On Xcode 7.2). The error was:
dyld: could not load inserted library '/private/var/mobile/Containers/Data/Application/A94F5AD3-2A5F-415D-B127-0F45DEC7A659/tmp/IDEBundleInjection.framework/IDEBundleInjection' because no suitable image found. Did find:
/private/var/mobile/Containers/Data/Application/A94F5AD3-2A5F-415D-B127-0F45DEC7A659/tmp/IDEBundleInjection.framework/IDEBundleInjection: mmap() error 22 at address=0x00501000, size=0x00005960 segment=__LINKEDIT in Segment::map() mapping /private/var/mobile/Containers/Data/Application/A94F5AD3-2A5F-415D-B127-0F45DEC7A659/tmp/IDEBundleInjection.framework/IDEBundleInjection

I had this same issue and had to reboot my device. I was using iOS 10 with Xcode 8.0 (developing in swift 3.0)

I needed to set the team under Project->App Target->General. It was set to "None", instead of a valid team.

I had my base SDK in XCode Build Settings set to a more recent version of iOS than the phone had, so I had to upgrade the OS on the phone.

I fixed this issue by rebooting my iOS Device.

Related

An empty identity is not valid when signing a binary for the product type 'Application' in xcode version 10.2

I have compile webrtc ios source code ,then I used the command:
gn gen out/ios --args='target_os="ios" target_cpu="arm64"' --ide=xcode
then I open the workspace with Xcode.
but when I compile the code, Xcode gives me this error below.
An empty identity is not valid when signing a binary for the product type 'Application'. (in target 'AppRTCMobile')
my Xcode version is 10.2, the latest version.
I really don't know how did this happen,can anyone can help me?
my code sign setting is:
everything looks ok.
I added CODE_SIGNING_ALLOWED=NO as an additional parameter and that fixed this issue for me.
I needed to to turn OFF Automatic manage signing and turn it ON afterwards. It seems like Xcode did fix some inconsistency by that action.
I saw this error in Xcode 12.2b when building to run on a device, but I had not set signing to Automatic, or selected profiles, etc.
Basically I was running and testing on the simulator, then plugged in a device for testing and forgot to change any signing settings.
Perhaps this error is new to Xcode 12.x for that scenario.
If you're using CocoaPods check your project.pbxproj for (null) references, there's an issue that make BuildFile references to become (null)
Even if you have the identity correctly defined it may be "empty" because of this issue
Try, as suggested:
pod deintegrate
pod install
This error can occur when an Xcode project is generated (rather than built from within xcode), and the generated output project is unexpectedly in release mode.
I was working on a Godot project and got the above error which led me to this post. The error is not WebRTC or Godot specific.
If you only want to debug the project for now on a device, and don't need release builds yet, switch to a debug scheme using the scheme switcher (1)
If the generator didn't create a debug scheme, (which is the case for me for my issue) you can add one via New Scheme (2)
At first I could not work out why it was complaining about "empty identity" (this refers to the Team drop down) when as per the screen shot I had this value set. I had the project view filter settings on Debug (as per the screenshot (3) so the Release settings (where Team was set to "None") were not showing up. Change this to All to see if that is where the None in the error is coming from for you.
Debug builds only require a basic signing setup. If you still have issues with Release builds when it comes time for that, you may need to clear out certificates & provisioning profiles from your Derived Data, Apple Developer portal and Keychain.
Release build certificates are hard to manage & replace so be careful with randomly generating & deleting them.
The problem has been fixed, it's my mistake.
Select the target, then choose info.plist and select the one for your project.

XCTest, Failed to load test bundle. Crash on test launch

In Xcode 9.1, I added a Unit Test Target to an older project and I'm not able to get tests to run. The target crashes on launch with the following error in the console:
The bundle “XXXTests” couldn’t be loaded because it doesn’t contain a version for the current architecture*
Full output:
2017-11-15 11:52:40.973 XXX[54962:16511010] Failed to load test bundle from file:///Users/XXX/Library/Developer/Xcode/DerivedData/XXX-gaxtmzjadfkxzsdciqnpmyczgntj/Build/Products/DEV-iphonesimulator/XXX.app/PlugIns/XXXTests.xctest/: Error Domain=NSCocoaErrorDomain Code=3585 "dlopen_preflight(/Users/XXX/Library/Developer/Xcode/DerivedData/XXX-gaxtmzjadfkxzsdciqnpmyczgntj/Build/Products/DEV-iphonesimulator/XXX.app/PlugIns/XXXTests.xctest/XXXTests): no suitable image found. Did find:
/Users/XXX/Library/Developer/Xcode/DerivedData/XXX-gaxtmzjadfkxzsdciqnpmyczgntj/Build/Products/DEV-iphonesimulator/XXX.app/PlugIns/XXXTests.xctest/XXXTests: mach-o, but wrong architecture" UserInfo={NSLocalizedRecoverySuggestion=Try installing a universal version of the bundle., NSFilePath=/Users/XXX/Library/Developer/Xcode/DerivedData/XXX-gaxtmzjadfkxzsdciqnpmyczgntj/Build/Products/DEV-iphonesimulator/XXX.app/PlugIns/XXXTests.xctest/XXXTests, NSLocalizedFailureReason=The bundle doesn’t contain a version for the current architecture., NSLocalizedDescription=The bundle “XXXTests” couldn’t be loaded because it doesn’t contain a version for the current architecture., NSDebugDescription=dlopen_preflight(/Users/XXX/Library/Developer/Xcode/DerivedData/XXX-gaxtmzjadfkxzsdciqnpmyczgntj/Build/Products/DEV-iphonesimulator/XXX.app/PlugIns/XXXTests.xctest/XXXTests): no suitable image found. Did find:
/Users/XXX/Library/Developer/Xcode/DerivedData/XXX-gaxtmzjadfkxzsdciqnpmyczgntj/Build/Products/DEV-iphonesimulator/XXX.app/PlugIns/XXXTests.xctest/XXXTests: mach-o, but wrong architecture, NSBundlePath=/Users/XXX/Library/Developer/Xcode/DerivedData/XXX-gaxtmzjadfkxzsdciqnpmyczgntj/Build/Products/DEV-iphonesimulator/XXX.app/PlugIns/XXXTests.xctest}
(And then some diagnostic output that I didn't include)
Stuff I've checked after extensively googling:
Build Active Architecture Only setting is consistent across the app and test targets (With a value of Yes)
Enable Testability is set to Yes for the main target
I've deleted the target and started over, no luck
How do I fix this?
Make sure iOS Deployment target fields of your application target and test target are the same
I had the same issue. Simply building and running the associated application target on an iOS11.1 simulator (which happens to match the "iOS Deployment Target" of Test target) it started working.
It seems starting the test the first time did not trigger a build of the test host. Subsequent runs seem to trigger the builds as needed and all is good.
YMMV
It happened to me when updating the Xcode version from 9.3 to 10. In my case, deleted the DerivedData, then the unit test works.
I had the same error. And for me what it worked was the following:
Select your test on the PROJECT NAVIGATOR
on the right side, in FILE INSPECTOR choose the Target Membership, in this case your test target.
In my case, The Team under Signing & Capabilities were different for both Target Membership
making the Team same for all Target Membership solved the issue for me.
I had a similar error. My tests were passing locally but failing on CI (Xcode Cloud). The fix for me was to set Enable Hardened Runtime to No for Debug.
(from https://www.jessesquires.com/blog/2020/02/23/mac-app-tests-fail-with-hardened-runtime/)
In my case, I had Mac version of OCMock.frameworked in Link Binary with Libraries build phrase for an iOS project.
Removing it solved the issue for me.
run with another ios11 device solve the problem

Unable to install app in simulator Xcode 9 beta

I downloaded Xcode 9 beta recently, and when I tried to run my app in the simulator it is not getting installed. I am getting this error in my Xcode every time I try to run the app.
This app was unable to be installed.
The application used to work in Xcode 8.3.3
Unfortunately, the error message doesn’t explain why the install failed. You can take a look at ~/Library/Logs/CoreSimulator/CoreSimulator.log to see if the rest of the error message is there with more info. If not, you should check out the sim device’s system log:
sudo xcode-select -s /Applications/Xcode-beta.app # if you haven’t already
xcrun simctl spawn booted log show
You can use --predicate to filter that down a bit.
Late answer but might be that can be useful for others. I just get a project with existing watch-kit and custom keyboard code. After change the identifier i got the same error and i spend 1 day to find out why that happens.
I checked everything of bundle id and all version. then i do global search in xcode with old identifier and i found that following.
Here in both .plist file have old WKCompanionAppBundleIdentifier so after i update it with new manually application run again.
IMPORTANT NOTE:
IF YOU ARE JUST CHANGE IDENTIFIER FROM GENERAL TAB THAT DOES NOT MEAN IT UPDATE AT ALL. KINDLY CHECK WITH ALL POSSIBLE PLACES BY SEARCH AND REPLACE IT WITH NEW IDENTIFIER.
XCODE VERSIO: Version 9.0 (9A235)
I ran into this same issue and a quick click on Product > Clean did the trick for me!
If you are using CocoaPods in your project please have a look at this answer: https://stackoverflow.com/a/44533287/221194
Changing the status of the pods subdirectory helped me with my project.
I had a similar issue when installing my App on the IOS simulator (with Xcode 9).
I found the issue (at least for my case), it was due to an unauthorized key (Privacy - Location When In Use Usage Description) in the info.plist of the Watch App.
I have moved this key to the info.plist of the WatchKit Extension and now the App installs again.
I hope it will help others people having the same issue.
change deployment target as per requirement.
select project > GENERAL > DEPLOYMENT TARGET
also check ios version of your device
I had the same issue. Log shows it's an error caused by Google Signin:
FunctionName=-[MobileInstallationHelperService stageItemAtURL:completion:], SourceFileLine=392, NSUnderlyingError=0x7f891e9a1270 {Error Domain=MIInstallerErrorDomain Code=4 "Failed to remove ACL" UserInfo={NSLocalizedDescription=Failed to remove ACL, FunctionName=-[MIFileManager _removeACLAtPath:isDir:error:]
However it works on iOS 9 & 10 simulator.
I got same error and I was using Cocoapods in my project and for me help just update pods.
I ran into this issue in Xcode 9.0 beta 5 after renaming a project that contained an iOS and watchOS app. To fix, I recreated the iOS target.
This issue could be triggered by multiple things however if you take a look at the logs at ~/Library/Logs/CoreSimulator/CoreSimulator.log and it states an error that reads :
NSUnderlyingError=0x7fb51c271ee0 Could not hardlink copy /originPath
to /destinationPath
it's possible that your Build number in your Project Target's settings is set to empty.
Go to Project Target > Identity > Build and set a Build number. You'll have to uninstall the the app in the simulator and re-install it before installing updated versions.
Please check the bundle identifier to solve the issue.
I had the same issue on XCode 9.3.1 when I wanted to add google map framework to my project manually.
To fix the problem I remove the google frameworks from Embedded binaries...

dyld: Library not loaded: #rpath/libswiftCore.dylib

I am trying to run a Swift app on my iPhone 4s. It works fine on the simulator, and my friend can successfully run it on his iPhone 4s. I have iOS 8 and the official release of Xcode 6.
I have tried
Restarting Xcode, iPhone, computer
Cleaning & rebuilding
Revoking and creating new certificate/provision profile
Runpath Search Paths is $(inherited) #executable_path/Frameworks
Embedded Content Contains Swift Code is 'Yes'
Code Signing Identity is developer
Below is the error in entirety
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: /private/var/mobile/Containers/Bundle/Application/LONGSERIALNUMBER/AppName.app/AppName
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/LONGSERIALNUMBER/AppName.app/Frameworks/libswiftCore.dylib: mmap() error 1 at
address=0x008A1000, size=0x001A4000 segment=__TEXT in Segment::map() mapping
/private/var/mobile/Containers/Bundle/Application/LONGSERIALNUMBER/APPLICATION_NAME/Frameworks/libswiftCore.dylib
For me none of the previous solutions worked. We discovered that there is an "Always Embed Swift Standard Libraries" flag in the Build Settings that needs to be set to YES. It was NO by default!
Build Settings > Always Embed Swift Standard Libraries
After setting this, clean the project before building again.
For keen readers some explanation
The most important part is:
set the Embedded Content Contains Swift Code (EMBEDDED_CONTENT_CONTAINS_SWIFT) build setting to YES in your app as shown in Figure 2. This build setting, which specifies whether a target's product has embedded content with Swift code, tells Xcode to embed Swift standard libraries in your app when set to YES.
The flag was formerly called Embedded Content Contains Swift Code
Surprisingly enough, all i did was "Clean" my project (shift+cmd+K) and it worked. Did seem to be related to the certificate though.
I started getting this error when I removed:
#executable_path/Frameworks
from Runpath Search Paths in my build settings. Replacing it fixed everything up again (thank goodness for source control!)
I don't know how it got there, but it appears to be needed for a binary to find its embedded Swift runtime.
For the device, you also need to add the dynamic framework to the Embedded binaries section in the General tab of the project.
In Xcode 8 the option for Embedded Content Contains Swift Code option is no longer available.
It has been renamed to "Always Embed Swift Standard Libraries = YES"
Xcode 13 here (13.1 with react-native).
Created a clean react-native project and saw /usr/lib/swift as an entry in Runpath Search Paths.
After adding that, my project finally ran without crashing!
Nothing helped from what was suggested before.
I think it's a bug when certificates are generated directly from Xcode. To resolve (at least in Xcode 6.1 / 6A1052d):
go to the Apple Developer website where certificates are managed: https://developer.apple.com/account/ios/certificate/certificateList.action
select your certificate(s) (which should show "Managed by Xcode" under "Status") and "Revoke" it
follow instructions here to manually generate a new certificate: https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html#//apple_ref/doc/uid/TP40012582-CH31-SW32
go to Xcode > Preferences > Accounts > [your Apple ID] > double-click your team name > hit refresh button to update certificates and provisioning profiles
I was having this issue with running my Swift tests (but not my app). It turns out that the test needed to have more than #executable_path/Frameworks in it's Runpath Search Paths build setting for the test target. Setting the Runpath Search Paths to the following worked a charm for me:
$(inherited)
#executable_path/Frameworks
#loader_path/Frameworks
OK, sharing here another cause of this error. It took me a few hours to sort this out.
In my case the trust policy of my certificate in Keychain Access was Always Trust, changing it back to defaults solved the problem.
In order to open the certificate settings window double click the certificate in the Keychain Access list of certificates.
This issue occurs again in Xcode 10.2. You must download and install the following package from Apple. It provides Swift 5 Runtime Support for Command Line Tools.
https://support.apple.com/kb/DL1998?locale=en_US
You have to set the Runpath Search Paths to #executable_path/Frameworks as showed in the following screenshot of Build Settings:
If you have any embedded frameworks made in Swift, than you can set to YES the Build Options Embedded Content Contains Swift Code.
I think Apple has already summarized it under Swift app crashes when trying to reference Swift library libswiftCore.dylib
Cited from Technical Q&A QA1886:
Swift app crashes when trying to reference Swift library
libswiftCore.dylib.
Q: What can I do about the libswiftCore.dylib loading error in my
device's console that happens when I try to run my Swift language app?
A: To correct this problem, you will need to sign your app using code
signing certificates with the Subject Organizational Unit (OU) set to
your Team ID. 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.
Usually this error appears in the device's console log with a message
similar to one of the following:
[....] [deny-mmap] mapped file has no team identifier and is not a platform binary:
/private/var/mobile/Containers/Bundle/Application/5D8FB2F7-1083-4564-94B2-0CB7DC75C9D1/YourAppNameHere.app/Frameworks/libswiftCore.dylib
Dyld Error Message:
Library not loaded: #rpath/libswiftCore.dylib
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000120021088
Triggered by Thread: 0
Referenced from: /private/var/mobile/Containers/Bundle/Application/C3DCD586-2A40-4C7C-AA2B-64EDAE8339E2/TestApp.app/TestApp
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/C3DCD586-2A40-4C7C-AA2B-64EDAE8339E2/TestApp.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x1001D8000, size=0x00194000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/C3DCD586-2A40-4C7C-AA2B-64EDAE8339E2/TestApp.app/Frameworks/libswiftCore.dylib
Dyld Version: 353.5
The new certificates are needed when building an archive and packaging
your app. Even if you have one of the new certificates, just resigning
an existing swift app archive won’t work. If it was built with a
pre-iOS 8 certificate, you will need to build another archive.
Important: Please use caution if you need to revoke and setup up a new
Enterprise Distribution certificate. If you are an in-house Enterprise
developer you will need to be careful that you do not revoke a
distribution certificate that was used to sign an app any one of your
Enterprise employees is still using as any apps that were signed with
that enterprise distribution certificate will stop working
immediately. The above only applies to Enterprise Distribution
certificates. Development certs are safe to revoke for
enterprise/standard iOS developers.
As the AirSign guys state the problem roots from the missing OU attribute in the subject field of the In-House certificate.
Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, OU=269J2W3P2L, O=Company Name, C=FR
I have an enterprise development certificate, creating a new one solved the issue.
Let's project P is importing custom library L, then you must add L into
P -> Build Phases -> Embed Frameworks -> +. That works for me.
This error message can also be caused when upgrading Xcode (and subsequently to a new version of Swift) and your project uses a framework built/compiled with an older/previous version of Swift.
In this case rebuilding the framework and re-adding it will fix the problem.
The most easy and easy to ignored way : clean and rebuild.
This solved the issue after tried the answers above and did not worked.
I was having the same problem after moving to a new mac, and after hours, trying all the suggested answers in the questions, none of this worked for me.
The solution for me was installing this missing certificate.
http://developer.apple.com/certificationauthority/AppleWWDRCA.cer
Found the answer here.
https://stackoverflow.com/a/14495100/976628
Change Copy Pods Resources for the target from:
"${SRCROOT}/Pods/Target Support Files/Pods-Wishlist/Pods-Wishlist-resources.sh"
to:
"${SRCROOT}/Pods/Target Support Files/Pods-Wishlist/Pods-Wishlist-frameworks.sh"
I solved by deleting the derived data and this time it worked correctly. Tried with Xcode 7.3.1GM
After having tried out everything, I finally found out, that the build seems not always include every detail again and again. Maybe for speeding up the process...
In order to ensure WHOLE packaging before running on a device, make a Clean first: Shift-Cmd-K.
Then build with: Cmd-B.
After that run it on your device.
Easy.
Kind regards to all you nice guys in that place!
We had a unity project that creates an xcode project that includes libraries that use swift.
We tried each and every reasonable suggestion on this thread.
Nothing worked. Code runs fine on new devices, and crashes on iOS<=12
It seems that swift is so smart, that even if you set it to "ALWAYS_EMBED_SWIFT_LIBRAIES"="YES" it does not include the swift libraries.
What actually solved the problem for us is to include a dummy swift file in the project.
The file must contain calls to dispatch, foundation libraries.
Apparently this hints mighty-xcode to force include the libraries, but this time for real.
Here is the dummy file we added that made it work:
import Dispatch
import Foundation
class ForceSwiftInclusion {
init() {
// Force dispatch library.
DispatchQueue.main.async {
print("something")
}
// Force foundation library.
let uuid = UUID().uuidString
print("\(uuid)")
}
}
For unity, also add project.AddBuildProperty(target, "SWIFT_VERSION", "Swift 5"); to your post processing for creating the xcode project.
In my case, it was just the name of my target :
I renamed it like this : MyApp.something and the same issue appeared.
But I saw in the build Settings window, my product module name has been changed like this MyApp-something.
So, I removed the dot in my target name (MyAppSomething) and the issue was gone.
For me, having tried everything with no success, what worked was to remove #executable_path/Frameworks from the Packaging section (don't know how it came to be in there in the first place)
What worked for me in Xcode 11 was going to General -> Frameworks, Libraries, and Embedded Content and changing the "Embed" option for the framework in question to "Embed & Sign"
None of the solutions worked for me. Restarting the phone fixed it. Strange but it worked.
none of these solutions seemed to work but when I changed the permission of the world Wide Developer cert to Use System defaults then it worked. I have included the steps and screenshots in the link below
I would encourage you to log the ticket in apple bug report as mentioned here as Apple really should solve this massive error:
https://stackoverflow.com/a/41401354/559760
I had the same issue for Xcode 13+ when I create a release build. Had to waste my time on troubleshooting this issue. Finally I was able to fix the issue with following step.
I added a new entry for Release in Runpath Search Paths in Build Settings -> Linking.
/usr/lib/swift
After adding that, I could run my app without crashing!
Xcode 7.2, iOS 9.2 on one device, 9.0 on other. Both had the error. No idea what changed that caused it, but the solutions above for the WWDR were correct for me. Install that cert and problem solved.
https://forums.developer.apple.com/message/43547
https://forums.developer.apple.com/message/84846
There are lot's of answers there but might be my answer will help some one.
I am having same issue, My app works fine on Simulator but on Device got crashed as I Lunches app and gives error as above. I have tried all answers and solutions . In My Case , My Project I am having multiple targets .I have created duplicate target B from target A. Target B works fine while target A got crashed. I am using different Image assets for each target. After searching and doing google I have found something which might help to someone.
App stop crashing when I change name of Launch images assets for both apps . e.g Target A Launch Image asset name LaunchImage A . Target B Lunch Image asset name LaunchImage B and assigned properly in General Tab of each target . My Apps works fine.
For me building a MacOS command line Swift app that depended on 3rd party Swift libs (e.g. SQLite) none of the above solutions seemed to work. What did work was directly adding the following path to my Runpath Search Paths in the Build Settings:
/Applications/Xcode.app/Contents//Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/
Doing that did give a warning at runtime saying that Xcode had found 2 versions of libswiftCore - which makes sense. Except that not including that line resulted in Xcode not finding any versions of libswiftCore.
Anyway, that'll do for me even if it doesn't seem right - my app is just a utility that I'm not intending to distribute and at least it runs now!
I have multiple version of Xcode installed at the same time. The framework was built with a newer version of Xcode. The app that I tried to compile was with an older version of Xcode. When I cleaned and compiled both the framework and the app with the same version of Xcode then things worked.

dyld: Library not loaded: #rpath/libswift_stdlib_core.dylib when running on iPhone

Update 2: This is an old question involving the developer beta of iOS 8 and Xcode. The problem was that the Swift standard library wasn't included in the iPhone 4s iOS 8 beta. The issue has been resolved in the release.
Update: I've been getting fed up with the errors and crashes that come along with beta software, so I decided to reset my phone to iOS 7.1.1 and now the error is gone... I have no idea what is going on, but I'm going to assume its a bug since iOS 8 is still in beta. I will file a bug report with Apple and hope it gets resolved with the next seed.
As many other people before me, I am receiving the following error message when running a swift-based app on my iPhone (4S running iOS 8.0 beta 1):
dyld: Library not loaded: #rpath/libswift_stdlib_core.dylib
Referenced from: /private/var/mobile/Containers/Bundle/Application/
CDC7263B-9F18-4369-87CC-F36DB5163B99/TESTPROJECT.app/TESTPROJECT
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/
CDC7263B-9F18-4369-87CC-F36DB5163B99/TESTPROJECT.app/Frameworks/
libswift_stdlib_core.dylib: mmap() error 1 at address=0x00206000,
size=0x00128000 segment=__TEXT in Segment::map() mapping
/private/var/mobile/Containers/Bundle/Application/
CDC7263B-9F18-4369-87CC-F36DB5163B99/TESTPROJECT.app/Frameworks/
libswift_stdlib_core.dylib
When running on the iOS simulator (iPhone 4S), I get the following (many times):
SetAppThreadPriority: setpriority failed with error 45
- This is a new single view application project generated from the built-in templates with Xcode 6 beta, with none of my own code. (Also happens with an empty application)
- I have already tried the solution found here (restarting Xcode)
I can't seem to find any other way of moving/accessing the required swift library.
For me, quitting and relaunching Xcode made this go away.
I ran into the same problem and I think it maybe because the app has to be configured to dynamically load certain frameworks. In any case changing the "Runpath Search Paths" build setting to "#executable_path/Frameworks" seemed to fix the problem.
I'm guessing that Xcode sets this automatically for new projects but older projects may need to be fixed manually. In my older project it was blank.
I hit this problem in simulator. I tried some settings listed here http://ikevin.tw/?p=174.
In summary, Defines Module -> Yes, Embedded Content Contains Swift Code -> Yes, Product Module Name -> [My product name].
These changes managed to get me to launch and run.
The trick is that afterwards, I reverted the changes to see which of them actually made a difference. After reverting all of them, the app still launched. So it's completely unclear what actually caused the app to end up launching.
I'm guessing your iPhone 4S is lower than iOS 6. We also did regression tests on iPhone 4S's on iOS 6 and 7 but they were all fine. Devices on iOS 5 and 5.1 had the same error as you have though.
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.
99% of the time when you get an error like this when upgrading the beta, it's the cache in ~/Library/Caches/com.apple.dt.Xcode* directories. Delete these and rebuild.
I had the same issue on an exploratory project. When I tried to build on a device I got the error. All I had to do was set the 'Provisioning Profile' in 'Code Signing' and everything worked.

Resources