3
votes

My application that works flawlessly in Debug/Development mode, crashes on launch in Distribution (Enterprise Distribution Build). Here's the crash log:

Incident Identifier: D03AA940-6D86-41E7-A90C-997C7C840570 CrashReporter Key: f79cf5348f25235e81156465863880c9a213ba09 Hardware Model: iPhone7,2 Process: EFC [1405] Path:
/private/var/containers/Bundle/Application/9C9BAABD-1BD5-4684-894E-329C6A11CE9C/MyApp.app/MyApp Identifier: com.company.ent-myapp Version: 100 (0.1) Code Type: ARM-64 (Native) Parent Process:
launchd 1

Date/Time: 2016-05-07 12:14:07.07 +0500 Launch Time:
2016-05-07 12:14:07.07 +0500 OS Version: iOS 9.3.1 (13E238) Report Version: 105

Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x000000012003d088 Triggered by Thread: 0

Filtered syslog: None found

Dyld Error Message: Dyld Message: Library not loaded: @rpath/Alamofire.framework/Alamofire Referenced from: /var/containers/Bundle/Application/9C9BAABD-1BD5-4684-894E-329C6A11CE9C/MyApp.app/MyApp Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/9C9BAABD-1BD5-4684-894E-329C6A11CE9C/MyApp.app/Frameworks/Alamofire.framework/Alamofire: mmap() errno=1 validating first page of '/private/var/containers/Bundle/Application/9C9BAABD-1BD5-4684-894E-329C6A11CE9C/MyApp.app/Frameworks/Alamofire.framework/Alamofire' /private/var/containers/Bundle/Application/9C9BAABD-1BD5-4684-894E-329C6A11CE9C/MyApp.app/Frameworks/Alamofire.framework/Alamofire: mmap() errno=1 validating first page of '/private/var/containers/Bundle/Application/9C9BAABD-1BD5-4684-894E-329C6A11CE9C/MyApp.app/Frameworks/Alamofire.framework/Alamofire' /private/var/containers/Bundle/Application/9C9BAABD-1BD5-4684-894E-329C6A11CE9C/MyApp.app/Frameworks/Alamofire.framework/Alamofire: mmap() errno=1 validating first page of '/private/var/containers/Bundle/Applicatio Dyld Version: 390.7

Binary Images: 0x100008000 - 0x10081ffff EFC arm64 <202501eaffad3aa4a30e701306b22a26> /var/containers/Bundle/Application/9C9BAABD-1BD5-4684-894E-329C6A11CE9C/MyApp.app/MyApp 0x12003c000 - 0x12006bfff dyld arm64 /usr/lib/dyld

  1. I've tried preparing the Enterprise Distribution build with Enable Bitcode Yes and No.
  2. I've verified multiple times that the code signing and provisioning profiles are setup properly.
  3. I have the latest/ renewed Apple Worldwide Developer Relations Certification Authority.
  4. I'm using cocoapods in my project, and I'm working with Release configurations, that are using Pods-MyApp.release. Note: I'm using cocoapods in my project for the first time. Incase it's relevant, content of my pods file are below for reference.

Contents of my Podfile:

platform :ios, '8.0'

use_frameworks!

target 'EFC' do

pod 'Alamofire', '~> 3.0'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
pod 'PayPal-iOS-SDK'

pod 'AlamofireNetworkActivityIndicator', '~> 1.0'
pod 'AlamofireImage', '~> 2.0'
pod 'ObjectMapper', '~> 1.2'

pod 'GoogleMaps'
pod 'UILoadControl'

end

I'm stumped. Any clue as to what's going on? How can I fix this and successfully prepare my enterprise build?

Maybe I'm missing something in cocoapods setup (for release/distribution), but I don't know what!?

Edit

The export dialog looks like this, if that makes any difference.

enter image description here

2
Are you using xcworkspace?Bhavuk Jain
Yes, I'm using xcworkspace, as required by cocoapods.Mustafa
is it working fine on simulator?Tyson Vignesh
Yes, working find on simulator and device, when I run in Debug/Development mode.Mustafa
I'm having the same problem with a fresh install El Capitain with Cocoapods 1.0 installed. I've installed new created certficates and profiles. I've removed cocoapods and reinstalled it . The app runs fine with Simulator . App created without cocoapods runs fine when I build but any project with cocoapods will build fine but crash as soon as i open it. Please help . Note that I have another MacBook that was upgraded to El Capitain and I have no issues building Enterprise Apps. Thank syanko

2 Answers

1
votes

I re-generated the Distribution CERTIFICATE, and profile. THIS resolved the issue for me!

0
votes

Wild guess: I assume that you use a build configuration that is not called Release in the Enterprise build. Try to add a build config to the pod frameworks with the same name as the build config you are using for your Enterprise build.