10 Replies
      Latest reply on Apr 2, 2019 11:37 PM by lstomberg
      rickyd Level 1 Level 1 (10 points)

        I've just started playing around with the Xcode 8 beta and am having trouble building an existing project. My problem target is a framework target which contains WatchKit code. The prefix header for the framework imports the WatchKit header like so:

         

        #import <WatchKit/WatchKit.h>
        

         

        When I build the target, I get several errors, the most notable to me being "Could not build module 'WatchKit'". The rest are (really, you can't upload screenshots here?):

         

        cpuid.h:

             GNU-style inline assembly is disabled

             GNU-style inline assembly is disabled

             GNU-style inline assembly is disabled

        internal.h

             Could not build module '_Builtin_intrinsics'

        SceneKitTypes.h

             Could not build module 'simd'

        WKInterfaceSCNScene.h

             Could not build module 'SceneKit'

        MyPrefixHeader.h

             Could not build module 'WatchKit'

         

        Is anyone else running into the same issue?

        • Re: Xcode 8 beta 1 cannot build WatchKit module
          HeaD Level 1 Level 1 (0 points)

          Same problem here.

          • Re: Xcode 8 beta 1 cannot build WatchKit module
            mhey Level 1 Level 1 (0 points)

            Same problem here.

             

            While building module 'WatchKit' imported from /Users/123456/Documents/Development/MobileWorkspace-Xcode8Beta/MyApp/Mobile Extension/SetupInterfaceController.h:8:
            While building module 'SceneKit' imported from /Applications/Xcode-beta.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator3.0.sdk/System/Library/Frameworks/WatchKit.framework/Headers/WKInterfaceSCNScene.h:11:
            While building module 'simd' imported from /Applications/Xcode-beta.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator3.0.sdk/System/Library/Frameworks/SceneKit.framework/Headers/SceneKitTypes.h:7:
            While building module '_Builtin_intrinsics' imported from /Applications/Xcode-beta.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator3.0.sdk/usr/include/simd/internal.h:52:
            In file included from <module-includes>:4:
            /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/cpuid.h:177:5: error: GNU-style inline assembly is disabled
                __cpuid(__level, *__eax, *__ebx, *__ecx, *__edx);
                ^
            /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/cpuid.h:151:10: note: expanded from macro '__cpuid'
                __asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \
                    ^
            /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/cpuid.h:187:10: error: GNU-style inline assembly is disabled
                __asm("  pushfl\n"
                    ^
            /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/cpuid.h:205:5: error: GNU-style inline assembly is disabled
                __cpuid(__level, __eax, __ebx, __ecx, __edx);
                ^
            /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/cpuid.h:151:10: note: expanded from macro '__cpuid'
                __asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \
                    ^
            3 errors generated.
            
            

             

            Submitted bug #26785123

            • Re: Xcode 8 beta 1 cannot build WatchKit module
              jbailey Level 1 Level 1 (0 points)

              Same issue here as well.  Any update?

              • Re: Xcode 8 beta 1 cannot build WatchKit module
                laddfromportland Level 1 Level 1 (0 points)

                As a temporary workaround, it looks like you can add "-fgnu-inline-asm" to the Other C Flags setting.

                • Re: Xcode 8 beta 1 cannot build WatchKit module
                  jeremyhu Apple Staff Apple Staff (160 points)

                  This issue is seen due to a combination of both of these compiler options:

                     -fno-gnu-inline-asm -fmodules

                   

                  You can workaround this issue by either disabling the use of clang modules or enabling the use of GNU inline asm.

                  • Re: Xcode 8 beta 1 cannot build WatchKit module
                    Zola Level 1 Level 1 (0 points)

                    I was just in the WWDC lab, and we came up with a simple solution: disable bitcode when building for the watchOS simulator.

                     

                    To fix:

                    1. Highlight the watch extension target and search for the "ENABLE_BITCODE" user defined setting

                    2. Mouse over your desired build configuration and tap the "+" button.

                    3. Select "Any watchOS Simulator SDK" and set a "NO" value to disable bitcode when building for the simulator.