7 Replies
      Latest reply on Jan 3, 2019 12:30 PM by janice
      Headsoft Level 1 Level 1 (0 points)

        Ref: From Apple's USBNotificationExample.c

         

        The following line of code:

        res = (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID), (LPVOID *)&privateDataRef->deviceInterface);

         

        Works fine in Xcode 9.4.1 but in Xcode 10.0 beta 6 I receive "couldn't create a device interface (80000004)" error message for all devices.

         

        This issue occurs on macOS High Sierra 10.13.6.

         

        Interestingly enough I do not have this issue on another machine running macOS Mojave 10.14 Beta 7 and Xcode 9.4.1 or Xcode 10.0 beta 6.

        • Re: USB Device Notification failure in Xcode 10
          ckent617 Level 1 Level 1 (10 points)

          I'm having the same issue - software that runs fine when built w/ XCode 9.4 can't access USB devices when built w/ Xcode 10. I'm running the latest Xcode 10 (the GM) and the latest developer beta of Mojave as of today. Developing on 10.13.6 as well.

           

          The code I'm building has been deployed successfully for several years on hundreds of thousands of Macs.

           

          Maybe we could compare notes... I'll post anything new I can find.

          • Re: USB Device Notification failure in Xcode 10
            ckent617 Level 1 Level 1 (10 points)

            It seems code built w/ XCode 10 GM only runs on 10.14, it won't run on 10.13 or 10.12.

            • Re: USB Device Notification failure in Xcode 10
              Headsoft Level 1 Level 1 (0 points)

              Tried signing the binary and turning on Capabilities->App Sandbox->Hardware->USB.

               

              Tried turning off SIP.

               

              Tried with Xcode 10 (10A255).

               

              I noticed in Xcode 9.4.1 the default compiler is "Apple LLVM 9.0" but in Xcode 10 it's "Apple Clang". Not sure if that makes a difference?

               

              Nothing so far has made a difference.

              • Re: USB Device Notification failure in Xcode 10
                ckent617 Level 1 Level 1 (10 points)

                Apple got back to me on the 20th (sorry for the delay, have been dealing with a flooded basement):

                 

                September 20 2018, 10:40 PM

                Engineering has the following feedback for you: You will need to specify a supported plugin interfaceID that is supported in the previous macOS’s. kIOUSBDeviceInterfaceID always uses the latest version which has API’s the early versions don’t have. You probably want to use kIOUSBDeviceInterfaceID650. Please see IOUSBLib.h for more details We are now closing this bug report. If you have questions or comments about the resolution, please update your bug report with that information so we can respond.