当我的应用程序说:应用程序已损坏且无法打开时发生了什么。您应该将其移至废纸篓

时间:2015-03-30 21:54:12

标签: macos

我写了一个应用程序,在我的机器上编译和签名。它适用于我团队中的其他开发人员,但是对于两个不同的人,一个使用OS X Mavericks,另一个使用Yosemite,它显示了此消息:

enter image description here

我能够在新的Yosemite安装上重现错误。当发生这种情况时,这就是我在日志中看到的内容:

30/03/2015 22:43:26.266 SpotlightNetHelper[256]: [SLSUGGESTIONS] Location managed failed with error Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed. (kCLErrorDomain error 0.)"
30/03/2015 22:43:27.250 CoreServicesUIAgent[263]: Error -60005 creating authorization
30/03/2015 22:43:27.357 CoreServicesUIAgent[263]: Error SecAssessmentCreate: The operation couldn’t be completed. (OSStatus error -67054.)
30/03/2015 22:43:31.687 com.apple.xpc.launchd[1]: (com.apple.xpc.launchd.oneshot.0x10000006.Screensaver Ninja[434]) Service exited due to signal: Killed: 9

环顾四周似乎签名可能是一个问题,但我可以验证它是否成功(我认为):

$ codesign -dvvv --deep /Applications/Screensaver\ Ninja.app
Executable=/Applications/Screensaver Ninja.app/Contents/MacOS/Screensaver Ninja
Identifier=com.carouselapps.Screensaver-Ninja
Format=bundle with Mach-O thin (x86_64)
CodeDirectory v=20200 size=3338 flags=0x0(none) hashes=159+3 location=embedded
Hash type=sha1 size=20
CDHash=c6c5fc1072a7e495969c3223f0950ceb53e246a7
Signature size=8533
Authority=Developer ID Application: Carousel Apps Ltd (XHT4M2DATL)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=30 Mar 2015 18:29:31
Info.plist entries=23
TeamIdentifier=XHT4M2DATL
Sealed Resources version=2 rules=12 files=35
Nested=Frameworks/libswiftObjectiveC.dylib
Nested=Frameworks/Sparkle.framework
Nested=Frameworks/Paddle.framework
Nested=Frameworks/HockeySDK.framework
Nested=Frameworks/libswiftCore.dylib
Nested=Frameworks/libswiftDispatch.dylib
Nested=Frameworks/libswiftFoundation.dylib
Nested=Frameworks/libswiftCoreGraphics.dylib
Nested=Frameworks/libswiftSecurity.dylib
Nested=Frameworks/libswiftDarwin.dylib
Nested=Frameworks/libswiftQuartzCore.dylib
Nested=Frameworks/libswiftAppKit.dylib
Internal requirements count=2 size=896

有什么想法可能会发生什么?

该应用可在https://s3.amazonaws.com/screensaver-ninja/macosx/ScreensaverNinja-1.0-alpha-1.dmg

上找到

1 个答案:

答案 0 :(得分:1)

问题是由于此选项删除了标题,框架被损坏:RemoveHeadersOnCopy。

从我的框架中删除该选项后,此错误消失了。这有助于:

$ codesign -dvvv --deep --verify /Applications/Screensaver\ Ninja.app
--prepared:/Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/.
--prepared:/Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/.
/Applications/Screensaver Ninja.app: a sealed resource is missing or invalid
In subcomponent: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/CrashReporter.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSignalInfo.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportMachineInfo.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportBinaryImageInfo.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportExceptionInfo.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportMachExceptionInfo.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReport.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSymbolInfo.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSystemInfo.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReporter.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashNamespace.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportProcessorInfo.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportProcessInfo.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportTextFormatter.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReporterConfig.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportRegisterInfo.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportStackFrameInfo.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportThreadInfo.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportFormatter.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashReportApplicationInfo.h
file missing: /Applications/Screensaver Ninja.app/Contents/Frameworks/HockeySDK.framework/Versions/Current/Frameworks/CrashReporter.framework/Versions/Current/Headers/PLCrashFeatureConfig.h

我还需要按照https://developer.apple.com/library/mac/documentation/IDEs/Conceptual/AppDistributionGuide/DistributingApplicationsOutside/DistributingApplicationsOutside.html中说明的步骤操作,以获得正确签名的.app文件。