I have this problem as well using Xcode 13.2.1 and Swift 5.5.2. I think Apple broke something in the ITLibrary framework. When I call musicFolderLocation method on the ITLibrary, the URL path returned is completely fubar. It has “/Volumes/Music 1/iTunes/iTunes Media“. First of all, I don't even have a volume named “Music 1“ and I haven't used “iTunes“, or that naming convention, since Apple moonlighted it a long time ago. So I wanted to find out where the problem was, and it appears the ITLibrary is using a UserDefaults value from “iTunes-media-folder-url“ in “com.apple.AMPLibraryAgent.“ So I guess they still haven't gotten everything right with Music. The Music app is buggy as hell and I reported that to them since Catalina and it remains the same, if not worse with each new OS release. Anyway, I don't know if it would harm anything to manually rewrite that UserDefault or not, but until Apple fixes this, right now I don't see a way around it.
Topic:
Programming Languages
SubTopic:
Swift
Tags: