clang error unknown unknown' -fno-obj-arc' AFNetworking Xcode 5.1

时间:2014-05-16 19:50:54

标签: ios xcode clang afnetworking afnetworking-2

所以我尝试在iPhone 7上运行我的应用程序,ASIHttp无效。经过一番搜索,我看到人们正在迁移到AFNetworking,所以我决定这样做。这是我做的:

  • 将Xcode更新为版本5.1
  • 按照说明here (设置cocoapods,安装afnetworking,更改项目)

并试图跑。第一次构建失败,显示以下消息:

clang: error: unknown argument: '-fno-obj-arc' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

我发现的这两个报告只有2个,这里和

他们告诉我在进行pod下载时添加一些标记:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future

那样做又试了一次,但没有用。现在我甚至不能回到另一个项目。到目前为止有没有人处理过这个问题?该选项在命令行中,但我找不到任何删除它。反正我不认为我应该这样做。

这是命令行,您可以在AFNetworking之后立即看到参数:

ProcessPCH /Users/cesarc/Library/Developer/Xcode/DerivedData/SPCMobile-aaaxjlqvwxhxfbhebqibusfjonip/Build/Intermediates/PrecompiledHeaders/SPCMobile-Prefix-bbhdqojfrkhfytgpvixlnglajmxy/SPCMobile-Prefix.pch.pch SPCMobile/SPCMobile-Prefix.pch normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/cesarc/Desktop/projetos/SPCMobile
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.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 i386 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-implicit-atomic-properties -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-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 -Wno-bool-conversion -Wenum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DCOCOAPODS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -fexceptions -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -fvisibility=hidden -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch -mios-simulator-version-min=5.1 -I/Users/cesarc/Library/Developer/Xcode/DerivedData/SPCMobile-aaaxjlqvwxhxfbhebqibusfjonip/Build/Intermediates/SPCMobile.build/Release-iphonesimulator/SPCMobile.build/SPCMobile.hmap -I/Users/cesarc/Library/Developer/Xcode/DerivedData/SPCMobile-aaaxjlqvwxhxfbhebqibusfjonip/Build/Products/Release-iphonesimulator/include -I/Users/cesarc/Desktop/projetos/SPCMobile/Pods/Headers -I/Users/cesarc/Desktop/projetos/SPCMobile/Pods/Headers/AFNetworking -I/Users/cesarc/Library/Developer/Xcode/DerivedData/SPCMobile-aaaxjlqvwxhxfbhebqibusfjonip/Build/Intermediates/SPCMobile.build/Release-iphonesimulator/SPCMobile.build/DerivedSources/i386 -I/Users/cesarc/Library/Developer/Xcode/DerivedData/SPCMobile-aaaxjlqvwxhxfbhebqibusfjonip/Build/Intermediates/SPCMobile.build/Release-iphonesimulator/SPCMobile.build/DerivedSources -F/Users/cesarc/Library/Developer/Xcode/DerivedData/SPCMobile-aaaxjlqvwxhxfbhebqibusfjonip/Build/Products/Release-iphonesimulator -DNS_BLOCK_ASSERTIONS=1 -isystem /Users/cesarc/Desktop/projetos/SPCMobile/Pods/Headers -isystem /Users/cesarc/Desktop/projetos/SPCMobile/Pods/Headers/AFNetworking -fno-obj-arc --serialize-diagnostics /Users/cesarc/Library/Developer/Xcode/DerivedData/SPCMobile-aaaxjlqvwxhxfbhebqibusfjonip/Build/Intermediates/PrecompiledHeaders/SPCMobile-Prefix-bbhdqojfrkhfytgpvixlnglajmxy/SPCMobile-Prefix.pch.dia -MMD -MT dependencies -MF /Users/cesarc/Library/Developer/Xcode/DerivedData/SPCMobile-aaaxjlqvwxhxfbhebqibusfjonip/Build/Intermediates/PrecompiledHeaders/SPCMobile-Prefix-bbhdqojfrkhfytgpvixlnglajmxy/SPCMobile-Prefix.pch.d -c /Users/cesarc/Desktop/projetos/SPCMobile/SPCMobile/SPCMobile-Prefix.pch -o /Users/cesarc/Library/Developer/Xcode/DerivedData/SPCMobile-aaaxjlqvwxhxfbhebqibusfjonip/Build/Intermediates/PrecompiledHeaders/SPCMobile-Prefix-bbhdqojfrkhfytgpvixlnglajmxy/SPCMobile-Prefix.pch.pch

1 个答案:

答案 0 :(得分:2)

检查构建阶段部分以获取编译源,您应该拥有无弧标志 -fno-objc- arc ),只需确保拼写正确。

  1. Build Phases:

  2. Compile Sources