Update to iOS 9 error: i386 Unsupported architecture

10,320

Solution 1

I also faces the same problem with Xcode 7.2 update. 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

Solution 2

Just run into the same problem while trying to build a project from command line and solved the issue by setting -sdk parameter to iphonesimulator:

xcodebuild .... -sdk iphonesimulator ...
Share:
10,320
xiaoyaoworm
Author by

xiaoyaoworm

You can contact me at [email protected] or check out my LinkedIn profile I am a software Engineer in Google.

Updated on June 07, 2022

Comments

  • xiaoyaoworm
    xiaoyaoworm about 2 years

    I have a project which will generate framework. My architecture setting is:

    • standard architecture(armv7, arm64)
    • i386

    Valid architecture: armv7, arm64, i386.

    In iOS 8.4, I can build it successfully without any problem. However, when I update to iOS 9. I get "Unsupported architecture" error. It looks like i386 is not supported, how can I make the framework which can be used in simulator?

    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?

  • nschum
    nschum over 8 years
    -destination 'platform=iOS Simulator,name=iPad' is the relevant bit. That argument supposedly is only for running tests. Looks like a bug in Xcode 7.2.
  • Admin
    Admin over 8 years
    yes, That solves me a problem. in fact , I cant mark my suggestion so it still left as unanswered.. if possible could you please tick it
  • xiaoyaoworm
    xiaoyaoworm about 8 years
    @M.R Hi on your project, choose your target, build phases-->in Run Script