I am trying to utilize ODR in my application, but the beginAccessingResources never completes. Below is a simplified version of my code:
let bundleResourceRequest = NSBundleResourceRequest(tags: tags)
bundleResourceRequest.beginAccessingResources { error in
DispatchQueue.main.async {
if let error = error {
bundleResourceRequest.endAccessingResources()
// Handle error
} else {
// Successful
}
}
}
I have started simple by tagging a .sks file with the tag Level1 and another .sks with the tag Home. When I begin access resources for the tag Home, I get a successful completion with no problem. However, when I try with the Level1 tag, the completion block never fires. I don't receive an error or success. When I look in Disk Report, it shows Home is In Use and Level1 is Downloading with a progress bar that never moves. Level1 is a total of 16 KB so it isn't too large, and I have let it sit for ~10 minutes with no success.
What could be causing this function to never complete?
I was able to fix this by going to Build Settings and changing Embed Asset Packs in Product Bundle to Yes for Debug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With