ios - clang 错误未知参数 '-fno-obj-arc' AFNetworking Xcode 5.1

标签 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

最佳答案

检查编译源Build Phases部分,您应该有No Arc flag (-fno-objc- arc) 那里,只要确保拼写正确即可。

  1. Build Phases:

  2. Compile Sources

关于ios - clang 错误未知参数 '-fno-obj-arc' AFNetworking Xcode 5.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23703501/

上一篇:ios - 从 KeychainItem 中检索值

下一篇:iOS 7 supportedInterfaceOrientation 没有按预期工作

相关文章:

gcc - x86_64 上的软浮点

ios - 将分页集成到自动完成本地搜索中

ios - UIWebView获取图标

objective-c - NSURLConnection 后查看 Controller Segue 延迟

ios - ld : framework not found DTXProfiler

gcc - 英特尔编译器/LLVM 上的并行位存储/并行位提取?

clang - CERN 开发的 Cling C++ JIT 解释器有多有用?

ios - 在 XCode 中组织 iOS OCUnit 测试文件

ios - 无法在 iOS 上从 Unity 运行 Vuforia 应用程序。代码签名无效

ios - 将图像添加到 bundle 的正确方法是什么?