簡體   English   中英

我該如何解決我希望提交到應用商店的iOS項目中的錯誤?

[英]How can I address errors in my iOS project which I hope to submit to app store?

當我嘗試為要提交的應用程序構建歸檔文件(第一次提交)時,遇到了很多錯誤,主要是與達爾文相關的導入錯誤:

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兼容性。 我該如何清除?

我還能如何解決這些錯誤?

通過仔細閱讀錯誤可以找到答案。 它似乎表明您的應用程序不支持arm64,它的目標是5.0.0。 如果此答案滿足您的用例,請不要忘記接受答案,以便其他用戶找到解決方案。

高級概念

剛引入Arm64是為了支持iOS7,因此在iOS5設備上不存在。 請記住,iOS5設備將不支持任何iOS7特定功能。

低層細節

特定於您看到的錯誤:

請注意有效架構設置的定義:

實際應針對其構建目標的體系結構的空格分隔列表。 對於每個目標,此列表與“體系結構”中指定的列表相交,並生成結果集。 這允許單個目標“退出”特定體系結構的建築。 如果生成的體系結構集為空,則不會生成可執行文件。 [VALID_ARCHS]

您可以通過從調試/發布代碼中刪除arm64文本來更改目標設備的體系結構。 這樣做的結果是,您的應用程序將僅在5s設備上以32位模式運行。 刪除arm64設置后,當前錯誤應該消失。

選擇您的項目>單擊構建設置> 有效架構

搜索“ arch”(無引號)> 搜索詞

雙擊進入“空白區域”(在“目標和項目”列下)>選擇“ arm64”>單擊彈出框底部的減號按鈕

彈出菜單

iOS5是32位操作系統。

如果要支持iOS5的部署目標,則需要轉到“構建設置”並從架構中刪除arm64,但將其保留在有效架構中。 只需保留armv7和armv7s。 64位設備(目前僅iPhone5 S)能夠運行32位代碼。 因此,除非您編寫了利用64位處理器的代碼,否則arm64對於包含在體系結構中並不是至關重要的。

如果您確實要支持arm64或不需要支持任何舊版本的iOS,則需要將部署目標更改為iOS7

這些錯誤中有很大一部分需要您將部署目標從5.0更改為7.0

如果您確實將其更改為7.0,則意味着運行iOS7的用戶將能夠下載並運行您的應用程序,但是擁有較舊版本的iOS的用戶將無法下載和運行您的應用程序。

或者,如果您想支持舊版本的iOS,則必須查找舊版本不支持的代碼的所有部分,並編寫一些支持代碼。

更改目標很容易,它位於應用程序目標的“常規”標簽上。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM