应用程序在启动时崩溃

Application crashing on launch

我的应用程序在 Debug/Development 模式下完美运行,但在 Distribution(Enterprise Distribution Build)中启动时崩溃。这是崩溃日志:

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. 我已经尝试使用 Enable Bitcode YesNo 准备企业分发版本。
  2. 我已多次验证代码签名和供应配置文件设置正确。
  3. 我有最新的/更新的Apple Worldwide Developer Relations Certification Authority
  4. 我在我的项目中使用 cocoapods,并且我正在使用 Release 配置,这些配置正在使用 Pods-MyApp.release。注意:我是第一次在我的项目中使用 cocoapods。如果相关,下面是我的 pods 文件的内容以供参考。

我的 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

我被难住了。关于发生了什么的任何线索?我该如何解决这个问题并成功准备我的企业构建?

也许我在 cocoapods 设置中遗漏了一些东西(对于 release/distribution),但我不知道是什么!?

编辑

导出对话框看起来像这样,如果这有什么不同的话。

大胆猜测:我假设您使用的构建配置在企业构建中未被称为 Release。尝试将构建配置添加到 pod 框架,其名称与您用于企业构建的构建配置同名。

我重新生成了分发证书和配置文件。这为我解决了问题!