我该如何解决iOS项目中的错误,以便提交到应用商店?

3
当我尝试为我要提交的应用构建存档(我的第一个提交)时,我遇到了一堆错误,主要是与Darwin相关的导入错误:
ProcessPCH /Users/jonathan/Library/Developer/Xcode/DerivedData/Steampunk_Clock-cblavmmgjxgqzpfwzbpirbdjpspm/Build/Intermediates/ArchiveIntermediates/Steampunk\ Clock/PrecompiledHeaders/Steampunk\ Clock-Prefix-gxthjnzoqzlexccyjihvntdifuwt/Steampunk\ Clock-Prefix.pch.pch Steampunk\ Clock/Steampunk\ Clock-Prefix.pch normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd "/Users/jonathan/Desktop/Steampunk Clock"
    setenv LANG en_US.US-ASCII
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c-header -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-cache-path=/Users/jonathan/Library/Developer/Xcode/DerivedData/ModuleCache -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -fvisibility=hidden -Wno-sign-conversion -miphoneos-version-min=5.0 -iquote /Users/jonathan/Library/Developer/Xcode/DerivedData/Steampunk_Clock-cblavmmgjxgqzpfwzbpirbdjpspm/Build/Intermediates/ArchiveIntermediates/Steampunk\ Clock/IntermediateBuildFilesPath/Steampunk\ Clock.build/Release-iphoneos/Steampunk\ Clock.build/Ancient\ Steampunk\ Clock-generated-files.hmap -I/Users/jonathan/Library/Developer/Xcode/DerivedData/Steampunk_Clock-cblavmmgjxgqzpfwzbpirbdjpspm/Build/Intermediates/ArchiveIntermediates/Steampunk\ Clock/IntermediateBuildFilesPath/Steampunk\ Clock.build/Release-iphoneos/Steampunk\ Clock.build/Ancient\ Steampunk\ Clock-own-target-headers.hmap -I/Users/jonathan/Library/Developer/Xcode/DerivedData/Steampunk_Clock-cblavmmgjxgqzpfwzbpirbdjpspm/Build/Intermediates/ArchiveIntermediates/Steampunk\ Clock/IntermediateBuildFilesPath/Steampunk\ Clock.build/Release-iphoneos/Steampunk\ Clock.build/Ancient\ Steampunk\ Clock-all-target-headers.hmap -iquote /Users/jonathan/Library/Developer/Xcode/DerivedData/Steampunk_Clock-cblavmmgjxgqzpfwzbpirbdjpspm/Build/Intermediates/ArchiveIntermediates/Steampunk\ Clock/IntermediateBuildFilesPath/Steampunk\ Clock.build/Release-iphoneos/Steampunk\ Clock.build/Ancient\ Steampunk\ Clock-project-headers.hmap -I/Users/jonathan/Library/Developer/Xcode/DerivedData/Steampunk_Clock-cblavmmgjxgqzpfwzbpirbdjpspm/Build/Intermediates/ArchiveIntermediates/Steampunk\ Clock/BuildProductsPath/Release-iphoneos/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/jonathan/Library/Developer/Xcode/DerivedData/Steampunk_Clock-cblavmmgjxgqzpfwzbpirbdjpspm/Build/Intermediates/ArchiveIntermediates/Steampunk\ Clock/IntermediateBuildFilesPath/Steampunk\ Clock.build/Release-iphoneos/Steampunk\ Clock.build/DerivedSources/arm64 -I/Users/jonathan/Library/Developer/Xcode/DerivedData/Steampunk_Clock-cblavmmgjxgqzpfwzbpirbdjpspm/Build/Intermediates/ArchiveIntermediates/Steampunk\ Clock/IntermediateBuildFilesPath/Steampunk\ Clock.build/Release-iphoneos/Steampunk\ Clock.build/DerivedSources -F/Users/jonathan/Library/Developer/Xcode/DerivedData/Steampunk_Clock-cblavmmgjxgqzpfwzbpirbdjpspm/Build/Intermediates/ArchiveIntermediates/Steampunk\ Clock/BuildProductsPath/Release-iphoneos --serialize-diagnostics /Users/jonathan/Library/Developer/Xcode/DerivedData/Steampunk_Clock-cblavmmgjxgqzpfwzbpirbdjpspm/Build/Intermediates/ArchiveIntermediates/Steampunk\ Clock/PrecompiledHeaders/Steampunk\ Clock-Prefix-gxthjnzoqzlexccyjihvntdifuwt/Steampunk\ Clock-Prefix.pch.dia -MMD -MT dependencies -MF /Users/jonathan/Library/Developer/Xcode/DerivedData/Steampunk_Clock-cblavmmgjxgqzpfwzbpirbdjpspm/Build/Intermediates/ArchiveIntermediates/Steampunk\ Clock/PrecompiledHeaders/Steampunk\ Clock-Prefix-gxthjnzoqzlexccyjihvntdifuwt/Steampunk\ Clock-Prefix.pch.d -c /Users/jonathan/Desktop/Steampunk\ Clock/Steampunk\ Clock/Steampunk\ Clock-Prefix.pch -o /Users/jonathan/Library/Developer/Xcode/DerivedData/Steampunk_Clock-cblavmmgjxgqzpfwzbpirbdjpspm/Build/Intermediates/ArchiveIntermediates/Steampunk\ Clock/PrecompiledHeaders/Steampunk\ Clock-Prefix-gxthjnzoqzlexccyjihvntdifuwt/Steampunk\ Clock-Prefix.pch.pch
error: invalid deployment target '5.0.0' for architecture 'arm64' (requires '7.0.0' or later) error: invalid deployment target '5.0.0' for architecture 'arm64' (requires '7.0.0' or later) 1 error generated. /Users/jonathan/Desktop/Steampunk Clock/Steampunk Clock/Steampunk Clock-Prefix.pch:7:9: fatal error: could not build module 'Darwin' #import ~~~~~~~^ error: invalid deployment target '5.0.0' for architecture 'arm64' (requires '7.0.0' or later) While building module 'UIKit' imported from /Users/jonathan/Desktop/Steampunk Clock/Steampunk Clock/Steampunk Clock-Prefix.pch:14: In file included from :1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitDefines.h:8:9: fatal error: could not build module 'Darwin' #import ~~~~~~~^ error: invalid deployment target '5.0.0' for architecture 'arm64' (requires '7.0.0' or later) error: invalid deployment target '5.0.0' for architecture 'arm64' (requires '7.0.0' or later) While building module 'UIKit' imported from /Users/jonathan/Desktop/Steampunk Clock/Steampunk Clock/Steampunk Clock-Prefix.pch:14: While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccelerometer.h:8: While building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6: In file included from :1: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11:10: fatal error: could not build module 'Darwin' #include ~~~~~~~~^ 2 errors generated. /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: fatal error: could not build module 'CoreFoundation' #include ~~~~~~~~^ error: invalid deployment target '5.0.0' for architecture 'arm64' (requires '7.0.0' or later) While building module 'UIKit' imported from /Users/jonathan/Desktop/Steampunk Clock/Steampunk Clock/Steampunk Clock-Prefix.pch:14: While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccelerometer.h:8: While building module 'ObjectiveC' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:6: In file included from :1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/objc/message.h:28: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/objc/objc.h:31:10: fatal error: could not build module 'Darwin' #include // for __DARWIN_NULL ~~~~~~~~^ 2 errors generated. error: invalid deployment target '5.0.0' for architecture 'arm64' (requires '7.0.0' or later) While building module 'UIKit' imported from /Users/jonathan/Desktop/Steampunk Clock/Steampunk Clock/Steampunk Clock-Prefix.pch:14: While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccelerometer.h:8: While building module 'Security' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:9: In file included from :1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:24: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:32:10: fatal error: could not build module 'Darwin' #include ~~~~~~~~^ 2 errors generated. 8 errors generated. error: invalid deployment target '5.0.0' for architecture 'arm64' (requires '7.0.0' or later) While building module 'UIKit' imported from /Users/jonathan/Desktop/Steampunk Clock/Steampunk Clock/Steampunk Clock-Prefix.pch:14: While building module 'CoreGraphics' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:8: In file included from :1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:8: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h:159:11: fatal error: could not build module 'Darwin' # include ~~~~~~~~^ 2 errors generated. error: invalid deployment target '5.0.0' for architecture 'arm64' (requires '7.0.0' or later) While building module 'UIKit' imported from /Users/jonathan/Desktop/Steampunk Clock/Steampunk Clock/Steampunk Clock-Prefix.pch:14: While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIColor.h:10: In file included from :1: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.h:8:9: fatal error: could not build module 'Foundation' #import ~~~~~~~^ error: invalid deployment target '5.0.0' for architecture 'arm64' (requires '7.0.0' or later) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h:16:10: fatal error: could not build module 'Darwin' #include ~~~~~~~~^ 2 errors generated. 4 errors generated. error: invalid deployment target '5.0.0' for architecture 'arm64' (requires '7.0.0' or later) While building module 'UIKit' imported from /Users/jonathan/Desktop/Steampunk Clock/Steampunk Clock/Steampunk Clock-Prefix.pch:14: While building module 'CoreText' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSText.h:9: In file included from :1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h:20: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h:29:11: fatal error: could not build module 'Darwin' # include ~~~~~~~~^ 2 errors generated. error: invalid deployment target '5.0.0' for architecture 'arm64' (requires '7.0.0' or later) While building module 'UIKit' imported from /Users/jonathan/Desktop/Steampunk Clock/Steampunk Clock/Steampunk Clock-Prefix.pch:14: While building module 'QuartzCore' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewLayout.h:11: In file included from :1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAAnimation.h:6: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h:6: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTiming.h:6: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h:13: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0/include/stdint.h:33:16: fatal error: could not build module 'Darwin' # include_next ~~~~~~~~~~~~~^ error: invalid deployment target '5.0.0' for architecture 'arm64' (requires '7.0.0' or later) While building module 'UIKit' imported from /Users/jonathan/Desktop/Steampunk Clock/Steampunk Clock/Steampunk Clock-Prefix.pch:14: While building module 'QuartzCore' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewLayout.h:11: While building module 'OpenGLES' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEAGLLayer.h:7: In file included from :1: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGL.h:8:10: fatal error: could not build module 'Foundation' #include ~~~~~~~~^ 2 errors generated. 4 errors generated. 22 errors generated. 25 errors generated.

看起来我要求一个64位设备与iOS 5.0兼容性,如何清除这个要求?

还有其他方法可以解决这些错误吗?


1
arm64 只能在 iOS7 上运行,因此您可以从架构中删除 arm64 或将 iOS7 设置为您的部署目标。 - Adam Richardson
1
可能需要将最低IOS版本更改为7.0。 - Eric
3个回答

5
答案可以在仔细阅读错误信息后找到。它似乎表明,arm64不支持您的目标版本为5.0.0的应用程序。需要注意的是,iOS5设备将不支持任何iOS7特定功能。
针对您所看到的错误,请注意“有效架构设置”的定义:
这是一个以空格分隔的列表,指定了实际上应该构建目标的体系结构。对于每个目标,此列表与“Architectures”中指定的列表相交,并构建生成的集合。这允许单个目标“退出”构建特定的体系结构。如果生成的体系结构集为空,则不会生成可执行文件。
您可以通过从您的调试/发布代码中删除arm64文本来更改您要针对的设备体系结构。这样做的效果是,您的应用程序将仅以32位模式在5s设备上运行。当您删除arm64设置时,当前错误应消失。
选择您的项目 > 点击“构建设置”> 搜索“arch”(不包括引号)> 双击白色空间(在Target和Project列下)> 选择arm64 > 在弹出框底部点击减号按钮。

1

iOS5 是一个32位操作系统。

如果您想支持 iOS5 的部署目标,那么您需要在构建设置中删除架构中的arm64,但是保留它在有效架构中。只保留armv7和armv7s。64位设备(目前仅限于 iPhone5 S)能够运行32位代码。因此,除非您编写了可利用64位处理器的代码,否则不需要将arm64包含在架构中。

如果您真的想支持arm64或者没有要求支持任何旧版本的iOS,则需要将部署目标更改为iOS7。


0

大量的这些错误需要您将部署目标从5.0更改为7.0

如果您将其更改为7.0,则意味着运行iOS7的人可以下载和运行您的应用程序,但是任何使用旧版本iOS的人都不能。

或者,如果您想支持旧版本的iOS,则必须找到所有不受旧版本支持的代码部分,并编写一些支持代码。

更改目标很容易,在应用程序目标的“常规”选项卡上即可完成。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接