3

首先,我要感谢您创建这个库。我已经将它嵌入到我的项目中(如 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/)没有任何成功。是否有可能您需要更改与证书相关的内容?

非常感谢您的任何回答

4

1 回答 1

1

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

原来,旧的 Apple WWDR Cert 已于 2016 年 2 月 14 日过期。如果您的 OSX 在 Keychain Access 中仍有过期的证书,您的分发证书将被视为无效。(一条红线显示“此证书的颁发者无效”)您可以在 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中发布的解决方案- 删除“系统”钥匙串中旧的、过期的 WWDR 证书。

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

“应用程序的开发版本一切正常”的原因是应用程序的开发版本由您自己的开发人员证书签名,而不是您组织的分发证书。不过,我不明白为什么开发人员证书不受 WWDR 到期的影响。但是我可以验证 dev 签名的二进制文件确实设置了 TeamIdentifier,而 dist 签名的二进制文件没有。

于 2016-03-16T09:12:31.367 回答