Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 8.0.2 Library Not Loaded libswiftCore.dylib

I have an application that uses HealthKit and Swift in it, everything compiles and runs fine when I test it from Xcode on a simulator or a device. I tested, debugged it, and submitted it to the iTunes store. When the application was approved I downloaded the new version from the store and it crashed right away. This was extremely puzzling as I have never had this issue before. I look at the diagnostic and usage logs on my phone and the crash report for the application says this:

Dyld Error Message: Library not loaded: @rpath/libswiftCore.dylib Reference from: /path/to/my/app Reason: no suitable image found. Did find: /path/to/my/app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x100174000, size=0x0194000 segment=__TEXT in Segment::map()

Has anyone seen anything like this or know how to deal with it?

Thank you

EDIT:

The crashing issue magically fixed itself on the morning of October 4th, which tells me that this was an Apple issue. I have been emailing iTunes Connect Support, but they have not said one way or another what happened. I also opened a technical ticket without even a response back from Apple. This is pretty disappointing, not just for the fact that Apple is not being transparent about the issue, but also it makes me feel like I have no course of action later on down the road if this ever were to happen again.

like image 222
AgnosticDev Avatar asked Oct 03 '14 14:10

AgnosticDev


5 Answers

Simply do the following two steps:

1) Delete the App from the device (or simulator)

2) Clean your workspace (CMD+SHIFT+K or via menu Product->Clean)

3) Build and run your app again.

Magically helps every time with all that startup / deploy stuff...

I also often get something like "application not found on device" or signing problems etc. Minutes before everything worked well.

like image 128
Frithjof Schaefer Avatar answered Nov 19 '22 21:11

Frithjof Schaefer


This appears to possibly be a code signing issue on Apple's part, and the issue seems affect apps with embedded frameworks (including non-Swift apps). There are multiple accounts of developers being affected (myself included) who had only submitted an update, without changing any build settings. Some high profile apps appear to have been affected and tickets have been filed with Apple, but there has been no official response from them at this time.

EDIT: This has been confirmed.

like image 26
rjsamson Avatar answered Nov 19 '22 20:11

rjsamson


Edit:

The app was rejected, after making this change, for the same reason, however, I am confident that the problem has to do with a missing architecture version in the libswiftCore.


I am going to post this as the provisional answer. Xcode 6 Standard architectures exclude armv7s

Notice how the error says: Did find: /path/to/my/app/Frameworks/libswiftCore.dylib

So it did find the lib but it also says: Reason: no suitable image found.

After running lipo against the archived build it didn't contain armv7s in the swift library, or in the app binary. I manually added it per the link above and the binary now contains support for armv7s though the swift library still did not. My app is in expedited review so I should get feedback farily quick. I will follow up when that does happen.

like image 41
maxpower Avatar answered Nov 19 '22 20:11

maxpower


I had the exact same problem with one of my app version updates (FunKeyBoard 1.1).

After doing some research, looks like it was an Apple side issue for many apps updated on October 3rd. Apple fixed the issue on October 4th by releasing an update, same version number, without needing any fix/re-upload from the app developer.

Obviously an Apple side issue, but I'm surprised Apple is very quiet about it. Many developers, including myself, got angry emails from users, and poor app reviews, as a result.

like image 2
Enrico Pangan Avatar answered Nov 19 '22 20:11

Enrico Pangan


This error typically occurs when signing Swift apps with certificates that lack "OU" (Organizational Unit). All certificates created after the release of iOS 8 should have this. The simple solution is to create a new certificate to sign with.

For more details, see the official Apple comment here: https://developer.apple.com/library/ios/qa/qa1886/_index.html

like image 2
emidander Avatar answered Nov 19 '22 20:11

emidander