Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app crashes at launch as in house release build on iPhone - but debugging is fine #154

Closed
liuxuan30 opened this issue Jun 16, 2015 · 6 comments

Comments

@liuxuan30
Copy link
Member

I am desperate to look for help. So I have to post here for guidance. Please help

I have imported ios-charts in my Objective-C project, and running it in debug mode is fine. However, today I tried to archive and ad-hoc distribute my app, the app crashes at launch...

I have set the swift optimization to none for release mode, still no luck.

I have no log or trace since it's installed on iPhone 6. I am looking for help if anything I missed...

@liuxuan30
Copy link
Member Author

[update] I tried to remove all swift stuff and archive, everything is as usual now. However, once I drag the swift files into my Objective-C based project, Run(debug) the app is fine. But if archive(release) and install it on iPhone, immediate crash at launch. Anything what I am missing?

@danielgindi
Copy link
Collaborator

Maybe something in your compilation swttings for release mode?

‏בתאריך יום שלישי, 16 ביוני 2015, Xuan [email protected] כתב:

[update] I tried to remove all swift stuff and archive, everything is as
usual now. However, once I drag the swift files into my Objective-C based
project, Run(debug) the app is fine. But if archive(release) and install it
on iPhone, immediate crash at launch. Anything what I am missing?


Reply to this email directly or view it on GitHub
#154 (comment)
.

@liuxuan30
Copy link
Member Author

That's what I am looking for help. I have no idea where could be wrong. I only edited the build settings mentioned in README. I double checked the swift related settings are same as debug mode.

@liuxuan30
Copy link
Member Author

Alright, after hundreds of archiving and testing, I found it's being caused by in-house distribution.

Quote from my post: http://stackoverflow.com/questions/30867698/app-with-objective-c-and-swift-code-crash-at-launch-in-release-mode-debug-mode/30881865#30881865

All explained in details in this article :

https://www.airsignapp.com/ios-apps-using-swift-crash-when-signed-with-inhouse-certificate/

We can confirm that after create a new cert and .mobileprovision, no more issues.

We found origins that caused this issue, related to a missing attribute in “Subject” field InHouse Certificates :

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

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

What I have been tried:

  1. delete all swift code and compile - inhouse distribution good
  2. drag swift files and compile - inhouse distribution bad, app store distribution good
  3. choose optimization level to None for swift, objC, and both. result not impacted

After revoking old cert and request a new, I do see OU in the cert.

Hope this can help who's suffering this. If this helps you, goto my post and up vote, so more people can see it. Thanks.

@liuxuan30
Copy link
Member Author

footprint:

Dyld Error Message:
  Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /private/var/mobile/Containers/Bundle/Application/267DE14E-45B5-44AE-8A6C-017025327A4F/Compass.app/Compass
  Reason: no suitable image found.  Did find:
    /private/var/mobile/Containers/Bundle/Application/267DE14E-45B5-44AE-8A6C-017025327A4F/Compass.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x1005EC000, size=0x0015C000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/267DE14E-45B5-44AE-8A6C-017025327A4F/Compass.app/Frameworks/libswiftCore.dylib
  Dyld Version: 353.12

Binary Images:
0x12008c000 - 0x1200b3fff dyld arm64  <75c68bbe28b13fcd91014f15139742dc> /usr/lib/dyld
0x181774000 - 0x181774fff Accelerate arm64  <a2161063fee1315193bc488d0354f43e> /System/Library/Frameworks/Accelerate.framework/Accelerate
0x1826ac000 - 0x1828bffff CFNetwork arm64  <df5535d1633f375aa889f755db0a93b9> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
0x182c60000 - 0x182fbefff CoreFoundation arm64  <6548b13bef1f3f958d96266f7c4c44e0> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x182fc0000 - 0x183122fff CoreGraphics arm64  <92162d42d08d357ab66302a38d724828> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
0x183b94000 - 0x183decfff Foundation arm64  <509b484fb7b634b19673d50296d8278f> /System/Library/Frameworks/Foundation.framework/Foundation
0x1857c0000 - 0x185871fff MobileCoreServices arm64  <daa61b358c17365792c20df791224e26> /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
0x187100000 - 0x187292fff QuartzCore arm64  <e47923f08f343c3e98e77f22f674f234> /System/Library/Frameworks/QuartzCore.framework/QuartzCore
0x187518000 - 0x18756cfff Security arm64  <80b60ba1feba39afb6686e342398cce1> /System/Library/Frameworks/Security.framework/Security
0x187740000 - 0x1877b3fff SystemConfiguration arm64  <633d8a8abeaf3abda9b0401146f2b668> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
0x1877b8000 - 0x188138fff UIKit arm64  <f67965f71974303e90cfaed997ae36a3> /System/Library/Frameworks/UIKit.framework/UIKit
0x193a90000 - 0x193a91fff libSystem.B.dylib arm64  <9e8736fd5dda318abe4e597a531a625f> /usr/lib/libSystem.B.dylib
0x193d20000 - 0x193d76fff libc++.1.dylib arm64  <fd4810a47e6b31d3b5a8ceedf8ac6937> /usr/lib/libc++.1.dylib
0x1945a4000 - 0x1947a0fff libobjc.A.dylib arm64  <963fc34f80f9303da52a020af5a63e74> /usr/lib/libobjc.A.dylib
0x1948d8000 - 0x1949b5fff libsqlite3.dylib arm64  <a97fddbf637f349ab395149f86cd80be> /usr/lib/libsqlite3.dylib
0x194b6c000 - 0x194b7dfff libz.1.dylib arm64  <263f8bc085593d578ea393ba40438ee3> /usr/lib/libz.1.dylib

@liuxuan30
Copy link
Member Author

[deny-mmap] mapped file has no team identifier and is not a platform binary: /private/var/mobile/Containers/Bundle/Application/B7B2BE25-BEE1-4DD0-B6BD-2BF4E4932862/TestApp.app/Frameworks/libswiftCore.dylib

@liuxuan30 liuxuan30 changed the title app crashes at launch as release build on iPhone - but debugging is fine app crashes at launch as in house release build on iPhone - but debugging is fine Oct 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants