Swift Application Crashes 1-3 times in Distribution and starts working fine

Application goes as follows.In iOS8+ works fine. Issue is iOS7.1.2

1. Swift application, used deployment target 7.1. No internet connection(mostly closed network). Enterprise distribution
2. Have used objective-c files, so bridge is there.
3. Works fine in simulator and device when watchdog timer is not there.
4. In distribution, it waits for sometime and crashes. If taken again, it works.
5. Sometimes after installation starts working after 1st crash, sometimes after 2-3 crashes.
6. Once started, the application works fine without any issue.
7. If device is hard reset, the 4-6 steps repeat again.


The application hasn't even started and is crashing while loading libraries. I am providing the crashreport.


Incident Identifier: 640032D5-9011-42B9-B6BE-94119151EF16
CrashReporter Key: c3e8152a82b544c5bd8c034eda2cb360ae1d2255
Hardware Model: iPad3,4 Process: MyApp [120]
Path: /var/mobile/Applications/7938481F-47AD-4C7B-B278-91AF8474D108/MyApp.app/MyApp
Identifier: com.companyname.MyApp
Version: 1 (2.0)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2015-07-06 19:19:14.869 +0900
OS Version: iOS 7.1.2 (11D257)
Report Version: 104
Exception Type: 00000020

Exception Codes: 0x000000008badf00d

Highlighted Thread: 0

Application Specific Information:com.companyname.MyApp failed to launch in time

Elapsed total CPU time (seconds): 1.720 (user 1.720, system 0.000), 4% CPU

Elapsed application CPU time (seconds): 0.003, 0% CPU

Thread 0:

0 dyld 0x2bef6d14 __fcntl + 8

1 dyld 0x2bef6956 fcntl + 78

2 dyld 0x2bee7524 ImageLoaderMachO::loadCodeSignature(linkedit_data_command const*, int, unsigned long long, ImageLoader::LinkContext const&) + 32

3 dyld 0x2beeb54a ImageLoaderMachOCompressed::instantiateFromFile(char const, int, unsigned char const, unsigned long long, unsigned long long, stat const&, unsigned int, unsigned int, linkedit_data_command const*, ImageLoader::LinkContext const&) + 238

4 dyld 0x2bee6b44 ImageLoaderMachO::instantiateFromFile(char const, int, unsigned char const, unsigned long long, unsigned long long, stat const&, ImageLoader::LinkContext const&) + 204

5 dyld 0x2bede036 dyld::loadPhase6(int, stat const&, char const*, dyld::LoadContext const&) + 390

6 dyld 0x2bee19b0 dyld::loadPhase5stat(char const, dyld::LoadContext const&, stat, int, bool, std::__1::vector<char const, std::__1::allocator<char const*> >) + 296

7 dyld 0x2bee17c6 dyld::loadPhase5(char const, char const, dyld::LoadContext const&, std::__1::vector<char const, std::__1::allocator<char const*> >) + 390

8 dyld 0x2bee161c dyld::loadPhase4(char const, char const, dyld::LoadContext const&, std::__1::vector<char const, std::__1::allocator<char const*> >) + 128

9 dyld 0x2bee135a dyld::loadPhase3(char const, char const, dyld::LoadContext const&, std::__1::vector<char const, std::__1::allocator<char const*> >) + 518 10 dyld 0x2bee0fd0 dyld::loadPhase1(char const, char const, dyld::LoadContext const&, std::__1::vector<char const, std::__1::allocator<char const*> >) + 108 11 dyld 0x2bedde0a dyld::loadPhase0(char const, char const, dyld::LoadContext const&, std::__1::vector<char const, std::__1::allocator<char const*> >) + 162 12 dyld 0x2beddbb4 dyld::load(char const*, dyld::LoadContext const&) + 208

13 dyld 0x2bee0a7e dyld::libraryLocator(char const, bool, char const, ImageLoader::RPathChain const*) + 42

14 dyld 0x2bee5034 ImageLoader::recursiveLoadLibraries(ImageLoader::LinkContext const&, bool, ImageLoader::RPathChain const&) + 784

15 dyld 0x2bee4ada ImageLoader::link(ImageLoader::LinkContext const&, bool, bool, bool, ImageLoader::RPathChain const&) + 66

16 dyld 0x2bedee8a dyld::link(ImageLoader*, bool, bool, ImageLoader::RPathChain const&) + 202

17 dyld 0x2bedf96c dyld::_main(macho_header const, unsigned long, int, char const, char const, char const, unsigned long) + 1420

18 dyld 0x2bedc22a dyldbootstrap::start(macho_header const, int, char const, long, macho_header const, unsigned long*) + 346

19 dyld 0x2bedc064 _dyld_start + 60

No thread state (register information) available

Binary Images:0x37000 - 0x272fff MyApp-II armv7 <e3aac697c78636d48999811814495664> /var/mobile/Applications/7938481F-47AD-4C7B-B278-91AF8474D108/MyApp-II.app/MyApp-II

0x2e8000 - 0x487fff libswiftCore.dylib armv7 <ca81d18b7890334694e9c2426a2293e2> /var/mobile/Applications/7938481F-47AD-4C7B-B278-91AF8474D108/MyApp-II.app/Frameworks/libswiftCore.dylib

0x5ca000 - 0x5e1fff libswiftCoreGraphics.dylib armv7 <dbb52d8303a438bb9b793a1bc4ff7c8b> /var/mobile/Applications/7938481F-47AD-4C7B-B278-91AF8474D108/MyApp-II.app/Frameworks/libswiftCoreGraphics.dylib

0x5f6000 - 0x5f9fff libswiftCoreImage.dylib armv7 <5a934d4aee463c46bc2bce0e447243bf> /var/mobile/Applications/7938481F-47AD-4C7B-B278-91AF8474D108/MyApp-II.app/Frameworks/libswiftCoreImage.dylib

0x602000 - 0x609fff libswiftDarwin.dylib armv7 <686e70965b003f318234b4a3886ec028> /var/mobile/Applications/7938481F-47AD-4C7B-B278-91AF8474D108/MyApp-II.app/Frameworks/libswiftDarwin.dylib

0x61a000 - 0x61dfff libswiftDispatch.dylib armv7 <b7b470f4a25b3bdb83150f9114ea014c> /var/mobile/Applications/7938481F-47AD-4C7B-B278-91AF8474D108/MyApp-II.app/Frameworks/libswiftDispatch.dylib

0x62a000 - 0x67dfff libswiftFoundation.dylib armv7 <718f87fd373c3865a481b11c6b606d95> /var/mobile/Applications/7938481F-47AD-4C7B-B278-91AF8474D108/MyApp-II.app/Frameworks/libswiftFoundation.dylib

0x2bedb000 - 0x2befefff dyld armv7s <4d05d388718832c99cdd4e74aeb07d51> /usr/lib/dyld

0x2de12000 - 0x2df55ff0 CoreFoundation armv7s <83decfd26c653905912f5cdb8743f5d9> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation

0x2df56000 - 0x2e07afff CoreGraphics armv7s <840c99b38b9f3ef497079f300ff15a1b> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics 0x2e803000 - 0x2e9edfff Foundation armv7s <52121842f9863ab49b775758dd05db0b> /System/Library/Frameworks/Foundation.framework/Foundation 0x30388000 - 0x304cffff QuartzCore armv7s <d5174e25cef83958adf812e37c93a41e> /System/Library/Frameworks/QuartzCore.framework/QuartzCore 0x306bb000 - 0x3070afff SystemConfiguration armv7s <3d6772f0ad5938558a4bc677965db338> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration

0x3070d000 - 0x30e80fff UIKit armv7s <e6756dd481773242b35fa4db5378453b> /System/Library/Frameworks/UIKit.framework/UIKit 0x3812b000 - 0x3812cfff libSystem.B.dylib armv7s <5c7ca1989cd733ad9d5cfd385d92876e> /usr/lib/libSystem.B.dylib

0x389c4000 - 0x38b63fff libobjc.A.dylib armv7s <bf3e22d3067133989a99a9bf07c4e8f8> /usr/lib/libobjc.A.dylib

0x38c69000 - 0x38d00fff libsqlite3.dylib armv7s <2bb2d0e7900a36d9a0a590bff69f3744> /usr/lib/libsqlite3.dylib

I'm seeing the same behavior. When I switch the device to a different wifi network that has internet connectivity, the app is able to launch. I'm concerned if this crash is what customers will experience if they use a closed wifi network (with no internet connectivity).

I'm experiencing this on an adhoc build, but I can't tell if it's related to the Wi-Fi network. My crash log is near identical. I've just submitted a Technical Support Incident to Apple, but in the meantime I'm wondering if either of you ever got any more insight into what's happening here.

I am facing the same issue on iOS 10 device built from Xcode 8.

Does anyone have a solution or clear reason identified for this problem?

Swift Application Crashes 1-3 times in Distribution and starts working fine
 
 
Q