about permission to access “Caches” work on iOS 14 but iOS15 fail - ios14

Error Domain=NSCocoaErrorDomain Code=513 "“-8985631368586039364” couldn’t be moved because you don’t have permission to access “Caches”." UserInfo={NSSourceFilePathErrorKey=/var/mobile/Media/Downloads/-1924357422564807023/-8985631368586039364, NSUserStringVariant=(
Move
), NSDestinationFilePath=/private/var/mobile/Containers/Data/Application/1DBCCEA5-71CD-470A-A315-4F5AD23AB361/Library/Caches/bgdl-3364-e54b4f1eaf236e91.xzip, NSFilePath=/var/mobile/Media/Downloads/-1924357422564807023/-8985631368586039364, NSUnderlyingError=0x280f14c30 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
my app will download file and save. it work on iOS14, but iOS15.
i can not catch any usefull exection when downloading fail(actually download finish, not call finish methos) .
I have no idea . Please help.

Related

Getting a PHAssetExportRequestErrorDomain error 0 and 2 when importing an image using a PHPickerViewController

I got this message when trying to import an image using a PHPickerViewController:
2022-10-29 12:52:17.775185+0200 screenfreeze[38500:5423936] [claims] 2AA2E9DE-9603-4723-B04C-35F09BB99667 grantAccessClaim reply is an error: Error Domain=NSCocoaErrorDomain Code=4101 "Couldn’t communicate with a helper application." UserInfo={NSUnderlyingError=0x600000f20330 {Error Domain=PHAssetExportRequestErrorDomain Code=0 "The operation couldn’t be completed. (PHAssetExportRequestErrorDomain error 0.)" UserInfo={NSLocalizedDescription=The operation couldn’t be completed. (PHAssetExportRequestErrorDomain error 0.), NSUnderlyingError=0x600000f20300 {Error Domain=PAMediaConversionServiceErrorDomain Code=2 "The operation couldn’t be completed. (PAMediaConversionServiceErrorDomain error 2.)" UserInfo={NSLocalizedDescription=The operation couldn’t be completed. (PAMediaConversionServiceErrorDomain error 2.)}}}}}
What causes this and how can I avoid it?
I got this error when I tried to select this flower picture from the iOS simulator:
The other sample pictures have no such issue.
I noticed that only that sample image is HDR. I think the issue is that the flower image is somehow corrupted, because it works with HDR images I took.
It's a known issue that the red flower image can't be selected using the simulator (63426347).
The issue only affects the simulator environment so it should work on actual hardwares. If you want to continue using the simulator to test, you can select other images instead.
See https://developer.apple.com/forums/thread/699155 for more information.

iOS - Error while uploading images from gallery

I'm building extension for my iOS app to upload Photos/Videos from gallery.
But When trying to convert url to NSData I got this error
Error Domain=NSCocoaErrorDomain Code=260 "The file “IMG_0015.JPG” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/var/mobile/Media/PhotoData/OutgoingTemp/6689587C-2A44-45D1-9DFF-841A3B890051/IMG_0015.JPG, NSUnderlyingError=0x12298d360 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
Sometimes I got this error too
Code=257 "The file couldn't be opened because you don’t have permission to view it
All permissions are set, so what's wrong here?

Fabric and AppPulse Conflict on iOS

My problem is that I am trying to have two tools for gathering statistics and crash information for my project, these tools are Fabric and AppPulse
I added Fabric successfully and crashes is showing on Fabric dashboard, but when I tried to add AppPulse I start to get this message from Fabric on Xcode console:
[Fabric] Unable to complete settings download Error
Domain=NSCocoaErrorDomain Code=4 "(null)"
UserInfo={NSSourceFilePathErrorKey=/spi/v2/platforms/ios/apps/com.cloudappers.RTA/settings,
NSUserStringVariant=(
Move ), NSDestinationFilePath=/Users/caosx01/Library/Developer/CoreSimulator/Devices/7C34D924-FC6E-4EF1-BD1B-0D16F44555D0/data/Containers/Data/Application/CF895D58-2844-4A8A-8EDE-BC092033E944/Library/Caches/io.fabric.sdk.ios.data/com.cloudappers.RTA/settings.json,
NSFilePath=/spi/v2/platforms/ios/apps/com.cloudappers.RTA/settings,
NSUnderlyingError=0x7fdb84890d80 {Error Domain=NSPOSIXErrorDomain
Code=2 "No such file or directory"}}
and I didn't receive any crashes from both tools after adding them together to the project.
I asked AppPulse support team and they recommended to disable crash capturing in hprummonitor.plist file:
<key>disableCrashReport</key>
<true/>
but after trying the recommended solution I still have the same log message.
Please any suggestion or solution or do I missing any thing here?

iOS 10 SpeechRecognition with Speech Kit error kAFAssistantErrorDomain - sample SpeakToMe

I'm working on the development of a demo like Siri with Speech Kit, but when I call recognitionTask = speechRecognizer.recognitionTask(with: recognitionRequest) {} to begin listening, it will immediately return an error:
Error Domain=SiriCoreSiriConnectionErrorDomain Code=16 "(null)"
My demo is very simple and almost the same as the sample code SpeakToMe in Xcode, so I tried that sample project and got the same error. I used a real device to debug, not a simulator, and both the privacy permissions about Usage of Microphone and Speech Recognition were added into the info.plist, I even tried adding all the privacy items including what I didn't use but it didn't work either.
I really need some help now. Anyone can give me some tips about this error? The full error message as follow:
Error:Optional(Error Domain=kAFAssistantErrorDomain Code=4 "(null)" UserInfo={NSUnderlyingError=0x17404ae30 {Error Domain=SiriCoreSiriConnectionErrorDomain Code=16 "(null)" UserInfo={NSUnderlyingError=0x17404b790 {Error Domain=NSOSStatusErrorDomain Code=-9806 "(null)" UserInfo={_kCFStreamErrorCodeKey=-9806, _kCFStreamErrorDomainKey=3}}}}})

WatchOS - presentMediaPlayerControllerWithURL not playing video

I'm trying to achieve a small app where you download an MP4 video in background on the watch, and play once downloaded.
Using WKInterfaceMovie.setVideoURL works well with an https link, but I want to customize the loading UI.
After downloading the video file, I move it to a shared group :
originalURL :
Optional("/private/var/mobile/Containers/Data/PluginKitPlugin/FD57E33D-4657-497B-9823-A53D289CDF0B/Library/Caches/com.apple.nsurlsessiond/Downloads/com.test.TestWatchVideo.watchkitapp.watchkitextension/CFNetworkDownload_jKLIrU.tmp")
destinationURL :
Optional("/private/var/mobile/Containers/Shared/AppGroup/018DA2BA-EB53-45DA-B3EA-792D4879E601/Library/Caches/SampleVideo_360x240_1mb.mp4")
I'm using removeItemAtURL ( if old file exist ) then copyItemAtURL to move the original file.
=> BUT when trying presentMediaPlayerControllerWithURL , it dismisses before playing video and says :
Error: Error Domain=com.apple.watchkit.errors Code=4 "The operation
could not be completed" UserInfo={NSLocalizedFailureReason=An unknown
error occurred (1), NSUnderlyingError=0x16d71f20 {Error
Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"},
NSLocalizedDescription=The operation could not be completed}
I've read quite a few threads on StackOverflow and Forums, and none have helped me.
Thanks !
OK, this was an issue of App Group Capabilities of the WatchKit App; The Application had the good right, the WatchKit App Extension was OK too, but WatchKit App didn't => Operation not permitted only when trying to play video.
This was working on the simulator, no matter you configuration.
switch on the App Groups of WatchKit App ...

Resources