Found the issue. I was initializing the AVAudioRecorder BEFORE switching the AVAudioSession category to .record. At least as of 16.2 beta 4, you now have to initialize it AFTER setting the record category. All fine with me, it's probably the recommended approach, but an error reason would be nice when .record() returns false, I'd been at this for 7 hours total before I finally got it.
Post
Replies
Boosts
Views
Activity
Hello! Any chance you found a solution when playing Apple Music alongside an AVAudioPlayer?
@davenorfleet Thanks for the workaround! I'm gonna have to try and tweak these, as it seems that sometimes the playlist fails to add the song (knowing MusicKit, I probably have to add a 0.1 seconds timer before calling the completion). But what's important is that I managed to get past the bug! :D Thanks!
@teststation5 check out my last message here https://developer.apple.com/forums/thread/658557?page=2 (not the accepted answer because I'm dumb, didn't know what that button did). Long story short, you gotta wrap the addToLibrary func in a dispatch that's not for the main queue.
Guys, I found the fix. Calling MPMediaLibrary.default().addItem(...) never reaches completion when called on the main thread. However, I wrapped it in a DispatchQueue.global(qos: .utility) {} and this made it work.
@davenorfleet even in 14.4 beta??? Damn, that sucks.
@JoeKun any updates?
@davenorfleet Hadn't tried that solution, but good to know it doesn't work lol. Here's another thread I started 2-3 months ago on which I see multiple people are active:
https://developer.apple.com/forums/thread/658557
With a little luck, maybe someone will give us some news there when they find anything.
Sad to hear there's no fix in 14.3. You're not the only one with this issue, I'll write here if I find any solution. You getting the following errors too?
[core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
[iTunesCloud] ACAccountStore 0x282436920 - Error retrieving iTunesStore accounts. err=Error Domain=com.apple.accounts Code=9 "(null)"
[iTunesCloud] ACAccountStore 0x282436920 - Error retrieving local store account. err=Error Domain=com.apple.accounts Code=9 "(null)"
[iTunesCloud] [ICUserIdentityStore] Failed to fetch local store account with error: Error Domain=com.apple.accounts Code=9 "(null)".
Official release of iOS 14 is out and this still isn't fixed.