My environment is:
Language: Swift
XCode: 6.1(the latest)
iOS: 8.1.1(the latest)
iPhone: 6 Plus
Apple Dev Program: Enterprise
I added MapKit to my project:
However, when archive the project and try to deploy to my iPhone 6 Plus, the app crashes. The log shows:
Dyld Error Message: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /private/var/mobile/Containers/Bundle/Application/D1C5A819-0D83-429B-BE32-606E34C1333F/ChiSha.app/ChiSha Reason: no suitable image found. Did find: /private/var/mobile/Containers/Bundle/Application/D1C5A819-0D83-429B-BE32-606E34C1333F/ChiSha.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x1000E4000, size=0x0018C000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/D1C5A819-0D83-429B-BE32-606E34C1333F/ChiSha.app/Frameworks/libswiftCore.dylib Dyld Version: 353.6Binary Images: 0x1200cc000 - 0x1200f3fff dyld arm64 <36eff49275c23d2d815e48af33eea471> /usr/lib/dyld 0x1836d4000 - 0x183a30fff CoreFoundation arm64 <83a9627362333366a8543e8c2d28166e> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 0x183a34000 - 0x183b96fff CoreGraphics arm64 <783a6b9356ed3b41beba516b483affb1> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics 0x183f40000 - 0x183f9dfff CoreLocation arm64 /System/Library/Frameworks/CoreLocation.framework/CoreLocation 0x1845d8000 - 0x18482cfff Foundation arm64 /System/Library/Frameworks/Foundation.framework/Foundation 0x18584c000 - 0x185960fff MapKit arm64 <6d62056699ed3d94ba264fa1f388d82d> /System/Library/Frameworks/MapKit.framework/MapKit 0x1860ec000 - 0x186198fff MobileCoreServices arm64 <19505cbb66af328785e293c3b2810b00> /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices 0x187d0c000 - 0x187d5efff Security arm64 <823c0a3088543396bef1e351da74c835> /System/Library/Frameworks/Security.framework/Security 0x187f24000 - 0x187f97fff SystemConfiguration arm64 /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration 0x187f9c000 - 0x188910fff UIKit arm64 <31ac3f3fa5153620907fbfbfd1d671b0> /System/Library/Frameworks/UIKit.framework/UIKit 0x19343c000 - 0x19343dfff libSystem.B.dylib arm64 /usr/lib/libSystem.B.dylib 0x193f4c000 - 0x194148fff libobjc.A.dylib arm64 /usr/lib/libobjc.A.dylib
I believe the key here is:
Library not loaded: @rpath/libswiftCore.dylib
and
Reason: no suitable image found. Did find:
Then according to this post, I added the Mapkit.framework to the General > Embedded Binaries:
However, there is an error saying:
error: strip /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/MapKit.framework/MapKit: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip exited with 1
I solved this by setting Building Setting > Strip Debug Symbols During Copy > Release to NO.
Then I can successfully achieve the project and export it as an Enterprise app.
However, I cannot even install the app now. If I run the app in debug mode, it shows:
I checked the log of my iPhone, and find the error saying:
Failed to load Info.plist from bundle at path /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.sdVgX8/extracted/ChiSha.app/Frameworks/MapKit.framework
It seems trying to load Info.plist from Mapkit.framework but failed.
Now I am totally confused, and have no idea what I should do.
Could anyone help?
Update:
I also included AFNetworking and TWMessageBarMessage through Pod.
Update 2:
I created a complete new project, and included the MapKit. The same error occurs, i.e. after achieving and exporting and installing the ipa, the app crashed with the error: Library not loaded: @rpath/libswiftCore.dylib