简体   繁体   English

更新到iOS 9错误:i386不支持的体系结构

[英]Update to iOS 9 error: i386 Unsupported architecture

I have a project which will generate framework. 我有一个将生成框架的项目。 My architecture setting is: 我的架构设置是:

  • standard architecture(armv7, arm64) 标准架构(armv7,arm64)
  • i386 I386

Valid architecture: armv7, arm64, i386. 有效架构:armv7,arm64,i386。

In iOS 8.4, I can build it successfully without any problem. 在iOS 8.4中,我可以毫无问题地成功构建它。 However, when I update to iOS 9. I get "Unsupported architecture" error. 但是,当我更新到iOS 9时,我收到“不支持的架构”错误。 It looks like i386 is not supported, how can I make the framework which can be used in simulator? 看起来不支持i386, 我该如何制作可以在模拟器中使用的框架?

Here is the error message: 这是错误消息:

CompileC build/iDock.build/Debug-iphoneos/iDock.build/Objects-normal/i386/iDockControl.o iDock/iDockControl.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/leon/Documents/Jul-27/iDock
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/local/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
    -x objective-c -arch i386 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/cy/52qx8n5j5qqfd4g4hsm9t1140000gn/C/com.apple.DeveloperTools/7.0-7A220/Xcode/ModuleCache/Session.modulevalidation
    -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -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 -Wconditional-uninitialized -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 -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk
    -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=9.0 -Wno-sign-conversion -fobjc-abi-version=2 -iquote /Users/leon/Documents/Jul-27/iDock/build/iDock.build/Debug-iphoneos/iDock.build/iDock-generated-files.hmap
    -I/Users/leon/Documents/Jul-27/iDock/build/iDock.build/Debug-iphoneos/iDock.build/iDock-own-target-headers.hmap
    -I/Users/leon/Documents/Jul-27/iDock/build/iDock.build/Debug-iphoneos/iDock.build/iDock-all-target-headers.hmap
    -iquote /Users/leon/Documents/Jul-27/iDock/build/iDock.build/Debug-iphoneos/iDock.build/iDock-project-headers.hmap
    -I/Users/leon/Library/Developer/Xcode/DerivedData/iDock-gqdfmhxadzmqcshdhlnmlbzodlrp/Build/Products/Debug-iphoneos/include
    -I/Users/leon/Documents/Jul-27/iDock/build/iDock.build/Debug-iphoneos/iDock.build/DerivedSources/i386
    -I/Users/leon/Documents/Jul-27/iDock/build/iDock.build/Debug-iphoneos/iDock.build/DerivedSources
    -F/Users/leon/Library/Developer/Xcode/DerivedData/iDock-gqdfmhxadzmqcshdhlnmlbzodlrp/Build/Products/Debug-iphoneos
    -MMD -MT dependencies -MF /Users/leon/Documents/Jul-27/iDock/build/iDock.build/Debug-iphoneos/iDock.build/Objects-normal/i386/iDockControl.d
    --serialize-diagnostics /Users/leon/Documents/Jul-27/iDock/build/iDock.build/Debug-iphoneos/iDock.build/Objects-normal/i386/iDockControl.dia
    -c /Users/leon/Documents/Jul-27/iDock/iDock/iDockControl.m -o /Users/leon/Documents/Jul-27/iDock/build/iDock.build/Debug-iphoneos/iDock.build/Objects-normal/i386/iDockControl.o While building module 'Foundation' imported from /Users/leon/Documents/Jul-27/iDock/iDock/iDockControl.h:10: While building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6: While building module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11: In file included from <module-includes>:1: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/include/sys/cdefs.h:707:2: error: Unsupported architecture error Unsupported architecture  ^ While building module 'Foundation' imported from /Users/leon/Documents/Jul-27/iDock/iDock/iDockControl.h:10: While building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6: While building module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11: In file included from <module-includes>:3: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/include/copyfile.h:36: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.0/include/stdint.h:63: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/include/stdint.h:52: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/include/sys/_types.h:33: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported error architecture not supported

Can someone help me to understand this and figure out this problem? 有人可以帮助我理解这一点并找出这个问题吗?

I also faces the same problem with Xcode 7.2 update. 我也面临与Xcode 7.2更新相同的问题。 found a solution, Hope this helps for you, 找到了解决方案,希望这对你有帮助,

Change script line which is used to build for simulator as follows, 更改用于为模拟器构建的脚本行如下,

xcodebuild -project ${PROJECT_NAME}.xcodeproj -scheme ${PROJECT_NAME} -sdk iphonesimulator -configuration ${CONFIGURATION} -destination 'platform=iOS Simulator,name=iPad' clean build CONFIGURATION_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphonesimulator 2>&1

正好碰上同样的问题,而试图建立的命令行项目,并通过设置-sdk参数iphonesimulator解决这个问题:

xcodebuild .... -sdk iphonesimulator ...

this didn't work for me, I had to also specify 这对我不起作用,我不得不另外说明

PLATFORM_NAME=iphonesimulator PLATFORM_NAME = iphonesimulator

Select your project: 选择你的项目:

Under Build Settings > Architectures Select Standard architectures - $(ARCHS_STANDARD) 构建设置>体系结构下选择标准体系结构 - $(ARCHS_STANDARD)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM