Post

Replies

Boosts

Views

Activity

SwiftData saying CoreData: error: Failed to stat path
This just started happening when installing my app on my phone and ipad. It still seems to work and the errors go away on the second installation, but it doesn't strike me as good. The app has not been released yet. When I remove the AppGroup, the error disappears. But I have a widget, so I need the AppGroup. I've cleaned the build, deleted derived files, and rebooted many times. I've deleted the app on the device and rebooted the device many times. I've deleted the AppGroup in iCloud and then recreated it. I was really hoping that would work, but nope. I've created a new App Group and that didn't make a difference either. So I'm stumped. Any thoughts on how to fix this? thanks CoreData: error: Failed to stat path '/private/var/mobile/Containers/Shared/AppGroup/2602E28B-089C-4011-BA09-19D11183E4F7/Library/Application Support/default.store', errno 2 / No such file or directory. CoreData: error: Executing as effective user 501 CoreData: error: Failed to statfs file; errno 2 / No such file or directory. CoreData: error: Logging status information for directory path: /private/var/mobile/Containers/Shared/AppGroup/2602E28B-089C-4011-BA09-19D11183E4F7/Library/Application Support CoreData: error: Executing as effective user 501 .... error: URL: file:///private/var/mobile/Containers/Shared/AppGroup/2602E28B-089C-4011-BA09-19D11183E4F7/Library/Application%20Support/default.store error: <NSPersistentStoreCoordinator: 0x300a3e610>: Attempting recovery from error encountered during addPersistentStore: 0x302f5f510 Error Domain=NSCocoaErrorDomain Code=512 "The file couldn’t be saved." UserInfo={reason=Failed to create file; code = 2} error: During recovery, parent directory path reported as missing error: Recovery attempt while adding <NSPersistentStoreDescription: 0x302f5f510> (type: SQLite, url: file:///private/var/mobile/Containers/Shared/AppGroup/2602E28B-089C-4011-BA09-19D11183E4F7/Library/Application%20Support/default.store) was successful!
1
0
475
Jul ’24
Timer Pauses When Playing Apple Music, AvAudioPlayer and Synthesizer
In my workout app, I play workout music locally using AvAudioPlayer. There's a one-second timer firing to update a countdown clock and progress circle. I also play text through the Synthesizer and sound effects through AvAudioPlayer. It all works smoothly. There's no hesitation at any time in the UI to update the countdown clock or progress circle. I added the ability to play music through Apple Music. Not everything works smoothly. Switching the audio session to duckothers mode to turn down the volume on Apple Music while the synth plays causes problems. You can't switch sessions while something is playing in AvAudioPlayer, which happens while I'm playing sound effects. It's a timing mess, but solvable. What I can't figure out is that in the periods when Apple Music is playing, the AvAudioPlayer is playing, and the synth is speaking, the UI visibly freezes for a second or so and then resumes. If I don't play sound effects through AvAudioPlayer, the UI does not freeze. I tried various "DispatchQueue.global(qos: options", but I think it all just goes into the OS subsystem anyway, so it's not really running in the calling thread context. So, after this torturous setup, is there a way to condition priorities, threads, or some other mechanism in swiftui to make sure the timer gets enough priority to operate smoothly at all times? thanks
0
0
506
Aug ’23
Change the Volume for ApplicationMusicPlayer to hear the voice synthesizer?
My app uses the voice synthesizer, and I'm trying to integrate apple music into my app using MusicKit to play a playlist during a workout. I want to lower the volume of the music while the synthesizer is speaking so the user can hear it. When I play music locally using AVAudioPlayer this is possible. I'm using the ApplicationMusicPlayer to play the tracks of the playlist. I don't see a way to lower the volume ApplicationMusicPlayer programmatically. Is there a way to programmatically change the volume of the ApplicationMusicPlayer? Or is there a better way to accomplish what I'm trying to do? thanks
1
0
599
Aug ’23