无法使用嵌入到我的项目中的ios-charts库来分发内部构建

时间:2015-10-21 06:47:52

标签: ios objective-c swift ios-charts

首先,我要感谢您创建此库。我将它嵌入到我的项目中(如README文件中所述),将其拖入项目中,将其嵌入到二进制文件中等等。目标iOS版本是8.0。

应用程序的开发版本的一切都很棒,但是一旦我构建了内部版本,应用程序会在初始欢迎屏幕显示后崩溃。崩溃的日志如下:

Oct 20 15:54:15 iPhone SpringBoard[54] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Oct 20 15:54:15 iPhone SpringBoard[54] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Oct 20 15:54:15 iPhone kernel[0] <Notice>: xpcproxy[700] Container: /private/var/mobile/Containers/Data/Application/6D451583-EE0E-4F0A-9CA9-2E33F83D6138 (sandbox)
Oct 20 15:54:15 iPhone kernel[0] <Notice>: AMFI: energy_challenge(pid 700) - [deny-mmap] mapped executable file has no team identifier in its signature: /private/var/mobile/Containers/Bundle/Application/84AEA7F2-4987-4119-B3CC-A4EAFC9989DC/energy_challenge.app/Frameworks/Charts.framework/Charts
Oct 20 15:54:15 iPhone com.apple.xpc.launchd[1] (UIKitApplication:com.edge5.nativeMenuEnergieInhouse[0x1f2e][700]) <Notice>: Service exited due to signal: Trace/BPT trap: 5
Oct 20 15:54:15 iPhone assertiond[63] <Warning>: Unable to obtain a task name port right for pid 700: (os/kern) failure (5)
Oct 20 15:54:15 iPhone SpringBoard[54] <Warning>: Unable to register for exec notifications: No such process
Oct 20 15:54:15 iPhone SpringBoard[54] <Warning>: Unable to obtain a task name port right for pid 700: (os/kern) failure (5)
Oct 20 15:54:15 iPhone SpringBoard[54] <Warning>: Unable to obtain a task name port right for <FBApplicationProcess: 0x13226dc00; com.edge5.nativeMenuEnergieInhouse; pid: 700>
Oct 20 15:54:15 iPhone SpringBoard[54] <Warning>: Application 'UIKitApplication:com.edge5.nativeMenuEnergieInhouse[0x1f2e]' crashed.
Oct 20 15:54:15 iPhone SpringBoard[54] <Warning>: Application '(null)' exited for an unknown reason.
Oct 20 15:54:15 iPhone ReportCrash[701] <Notice>: Formulating report for corpse[700] energy_challenge
Oct 20 15:54:15 iPhone ReportCrash[701] <Warning>: report not saved because the limit of 25 for 109_energy_challenge logs has been reached.
Oct 20 15:54:15 iPhone ReportCrash[701] <Error>: Notice: This report is abbreviated for syslog inclusion because it could not be saved to disk.
    Symbolication may be possible by manually cleaning up and including the Binary Image section of a full report from this same device -- good luck!
Oct 20 15:54:15 iPhone ReportCrash[701] <Error>: Process:             energy_challenge [700]
    Path:                /private/var/mobile/Containers/Bundle/Application/84AEA7F2-4987-4119-B3CC-A4EAFC9989DC/energy_challenge.app/energy_challenge
    OS Version:          iOS 9.0.2 (13A452)
Oct 20 15:54:15 iPhone ReportCrash[701] <Error>: Exception Type:  EXC_BREAKPOINT (SIGTRAP)
    Exception Codes: 0x0000000000000001, 0x0000000120095088
    Triggered by Thread:  0
Oct 20 15:54:15 iPhone ReportCrash[701] <Error>: Dyld Error Message:
    Dyld Message: Library not loaded: @rpath/Charts.framework/Charts
      Referenced from: /var/mobile/Containers/Bundle/Application/84AEA7F2-4987-4119-B3CC-A4EAFC9989DC/energy_challenge.app/energy_challenge
      Reason: no suitable image found.  Did find:
        /private/var/mobile/Containers/Bundle/Application/84AEA7F2-4987-4119-B3CC-A4EAFC9989DC/energy_challenge.app/Frameworks/Charts.framework/Charts: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/84AEA7F2-4987-4119-B3CC-A4EAFC9989DC/energy_challenge.app/Frameworks/Charts.framework/Charts'
      Dyld Version: 369.12
Oct 20 15:54:16 iPhone wifid[39] <Error>: WiFi:[467042056.241745]: Enable WoW requested by "apsd"
Oct 20 15:54:16 iPhone wifid[39] <Error>: WiFi:[467042056.243839]: Unable to dispatch WowStateChanged message to client dataaccessd (268435460)
Oct 20 15:54:16 iPhone wifid[39] <Error>: WiFi:[467042056.244041]: Unable to dispatch WowStateChanged message to client MobileMail (268435460)
Oct 20 15:54:16 iPhone wifid[39] <Error>: WiFi:[467042056.244185]: Unable to dispatch WowStateChanged message to client softwareupdatese (268435460)
Oct 20 15:54:16 iPhone wifid[39] <Error>: WiFi:[467042056.244422]: Unable to dispatch WowStateChanged message to client dataaccessd (268435460)
Oct 20 15:54:16 iPhone wifid[39] <Error>: WiFi:[467042056.244678]: Unable to dispatch WowStateChanged message to client assistantd (268435460)
Oct 20 15:54:16 iPhone wifid[39] <Error>: WiFi:[467042056.245010]: Unable to dispatch WowStateChanged message to client itunesstored (268435460)

问题出现在这里:

[deny-mmap] mapped executable file has no team identifier in its signature: /private/var/mobile/Containers/Bundle/Application/84AEA7F2-4987-4119-B3CC-A4EAFC9989DC/energy_challenge.app/Frameworks/Charts.framework/Charts

我尝试创建新证书,新的内部构建,基本上经历了关于此或类似问题的所有stackoverflow问题(例如https://www.airsignapp.com/ios-apps-using-swift-crash-when-signed-with-inhouse-certificate/),但没有任何成功。是否有可能您需要更改与您相关的证书相关内容?

非常感谢您的回答

1 个答案:

答案 0 :(得分:1)

当我搜索&#34; [deny-mmap]映射的可执行文件在其签名中没有团队标识符时,我遇到了这篇文章&#34;在Google上。

原来,旧的Apple WWDR证书已于2016年2月14日到期。如果您的OSX在Keychain Access中仍有过期证书,则您的分发证书将被视为无效。 (红线显示&#34;此证书的发行人无效&#34;)您可以强行&#34;信任&#34; Keychain Access中的证书,但副作用是签名的二进制文件在其签名中不会有TeamIdentifier:

$ codesign -d -vv MyApp.app
Executable=/Users/admin/MyApp.app/MyApp
Identifier=info.eddywong.MyApp
Format=bundle with Mach-O universal (armv7 arm64)
CodeDirectory v=20100 size=1920 flags=0x0(none) hashes=87+5 location=embedded
Signature size=4389
Authority=iPhone Distribution: Eddy Wong Limited (KG7UETNRCJ)
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Signed Time=15 Mar 2016 23:59:38
Info.plist entries=33
TeamIdentifier=not set
Sealed Resources version=2 rules=12 files=108

所以我必须按照https://stackoverflow.com/a/35400712中发布的解决方案 - 删除&#34; System&#34;中的旧的过期WWDR证书。钥匙串。

然后,我清理并重新存档,然后导出IPA。这一次有效!

为什么&#34;一切都适用于开发版的应用程序&#34;该应用程序的开发版本是由您自己的开发人员证书签署的,而不是您组织的分发证书。但我无法弄清楚为什么开发人员证书不会受到WWDR到期的影响。但我可以验证dev签名二进制文件是否设置了TeamIdentifier,而dist符号二进制文件没有设置。