Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Couldn't find MIDI network driver" crash in iOS 13 simulators

In Xcode 11 beta 6's iOS 13 simulators I'm getting a crash when enabling the MIDI Network Session.

I was able to replicate by adding the following lines to AppDelegate's didFinishLaunching:WithOptions: in a fresh project:

MIDINetworkSession.default().isEnabled = true
MIDINetworkSession.default().connectionPolicy = .anyone

When run in an iOS 13 simulator the app will crash at the first of these lines, printing "Couldn't find MIDI network driver" to the console. iOS 12 and earlier simulators are unaffected.

Strangely though it seems that not all of my iOS 13 simulators are affected. It seems that any iOS 13 simulators I had used from Xcode 11 beta 4 and earlier work correctly. The only simulators affected may be ones I used for the first time in Xcode 11 beta 5 onwards.

I'm assuming this is a beta software bug, and have already filed the bug with Apple. But I felt it smart to document here in case anyone else comes across it.


Update: 2019-09-11

This is still a problem for me with the simulators in the Xcode 11.0 GM seed (including the new iPhone 11 models).


Update: 2019-09-30

Issue still exists in Xcode 11.1 GM seed. I followed the steps in Evan's answer and that appeared to fix it.

like image 809
adamjansch Avatar asked Aug 21 '19 08:08

adamjansch


2 Answers

I was getting the same error as you and this frusturated me. I searched for a solution for four days, and finally found one. I hope this will help you as well! Please follow these steps carefully:

  1. Update Xcode to the latest version

  2. Make sure your build target deployment version is set to iOS 13.0

  3. Quit the applications Simulator and Xcode if they are open

  4. Using Finder, navigate to the folder which your version of Xcode is located (mine is in my Applications folder)

  5. Control + click on Xcode, and select 'Show Package Contents'

  6. Navigate to /Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime

  7. Control + click on 'iOS.simruntime', and select 'Show Package Contents'

  8. Navigate to /Contents/MacOS and verify you see a document named 'iOS 13.0'

  9. Exit out of the 'MacOS' folder back to the 'Contents' folder and Navigate to /Resources/RuntimeRoot/System/Library/Audio

  10. Copy the entire 'MIDI Drivers' folder

  11. Exit out of the 'Audio' folder and navigate all the way back to the 'RuntimeRoot' folder

  12. Navigate to /Library/Audio and you should see there is no folder called 'MIDI Drivers' here, only 'Plug-Ins' and 'Tunings'

  13. Paste the 'MIDI Drivers' folder you copied into this 'Audio' folder

  14. Close Finder, relaunch Xcode and try running your project again in the iOS 13 simulator

Now, Xcode should not complain about missing the MIDI Drivers, and your code should run without the EXE_BAD_ACCESS! I hope this helps, and please feel free to reach out to me if you have any more questions.

like image 181
Evan Murray Avatar answered Nov 18 '22 13:11

Evan Murray


This is just a simplification of the accepted answer, since I do this often. Assuming your Xcode is in /Applications/Xcode.app:

Copy MIDI Drivers from

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Audio

to

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Library/Audio

and relaunch Xcode.

Note

So it's present in RuntimeRoot/System/Library/Audio and needs to be in RuntimeRoot/Library/Audio as well.

like image 23
Dan Rosenstark Avatar answered Nov 18 '22 12:11

Dan Rosenstark