-
Notifications
You must be signed in to change notification settings - Fork 885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWSS3TransferUtility iOS 13 Download NSCocoaErrorDomain Code=257 file couldn’t be opened because you don’t have permission to view it #2105
Comments
hi @tripleA-max , Thanks for reporting the issue, could you provide a code snippet of how you are trying to download the file? Or even a sample app repo that we can use to reproduce the issue? |
I am having the same issue. With updated iOS 13, I am not able to download images or audio urls form the server. Same code is working for iOS 12. |
My issue is solved. I had a custom xcconfig file setup for bundle identifier so referencing that file from Info.plist had caused this error. |
|
let transferUtility = AWSS3TransferUtility.default() |
So I have a xcconfig file that my app reads App_name, Colors, etc from. So I changed And it worked. I debugged for the whole day just to find, that change had caused permission error in iOS 13. |
@PrekshyaBasnet Thank you so much for this explanation. This did not seem to be the issue for me. My bundle identifier is and has always been $(PRODUCT_BUNDLE_IDENTIFIER) as I did not use an xcconfig file. I'm afraid this was not the solution to my problem. Thank you for your timely response though, it was very much appreciated. |
hi @tripleA-max,
Can you clarify what is the call you are making with You also mentioned this is working on the simulator and not on the device, and that this is related to file permissions. Are you downloading the object stored in S3 down to a specific URL? Feel free to try out this sample to see if you can find any differences between your calling pattern and the one from the sample: https://github.com/awslabs/aws-sdk-ios-samples/tree/master/S3TransferUtility-Sample/Swift For example, to download data specified by a key in S3, you can check out https://github.com/awslabs/aws-sdk-ios-samples/blob/master/S3TransferUtility-Sample/Swift/S3BackgroundTransferSampleSwift/DownloadViewController.swift |
Hi,
The transfer utility download does work on any device running iOS 12 or lower and on an iOS 13 sim. It's just a physical device running iOS13 where it doesn't. |
maybe be related #2314 |
@tripleA-max This issue is really strange cause the issue in iPad still persists. But the issue does not exist for iPhone anymore. |
@PrekshyaBasnet Oh no way. Yea something with the SDK then maybe. Thank you so much for your feedback! |
Hi @tripleA-max , we just tried using the sample app and running it on a physical device on iOS 13.3.1 and things look fine. Could it be a setting on your device that is retricting some file permissions? It appears you are also using an older SDK version, can you try again with the latest version? Can you clarify, if the file permission error is coming from TransferUtility or after you have downloaded the data and writing to a file yourself? Did you reproduce this on the sample app or your own app? |
Hi @lawmicha I thought that could be the issue, but it just isn't my device that has this issue. Any device I use running iOS 13 gives me this problem. I updated awhile back and I am using Cocoapods 2.12.7 and I am still seeing the issue. The error comes back from the AWSS3TransferUtilityDownloadCompletionHandlerBlock. The file that is being downloaded is being downloaded for the sake of displaying its contents, not to be saved or written to. @PrekshyaBasnet Can you provide any more info on your issue with iPad? |
@tripleA-max I updated referencing the bundle Id in info.plist -> #2105 (comment), and it started working on iPhone and not in iPad. Yesterday just for testing, I changed the bundle id and ran on the iPad and it works. So my issue was all related to info.plist. Can you try changing bundle id and just see if it works that way? Just to see if its info.plist related problem. |
Hi @tripleA-max |
This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems. |
Hi, I'm wondering if you solved the issues @tripleA-max ? I'm experiencing this as well |
I have experienced this issue and have been troubleshooting for way too many hours... My issues were apparently also caused by some mistake in my bundle identifier in my plist info file as described by @PrekshyaBasnet |
Describe the bug
My application is using the S3 transfer utility to download a file from S3. On xcode simulators running iOS 13.2.2, there appears to be no issue with download. However, when the application is run ad hoc on a device of the same OS version, the download fails and the error reads as follows: Error Domain=NSCocoaErrorDomain Code=257 "The file couldn’t be opened because you don’t have permission to view it." UserInfo={Server=AmazonS3, Accept-Ranges=bytes, Content-Type=application/json.. etc). This has been a problem since updating my device to iOS 13. After checking with the AWS Cognito and S3 support teams, it was concluded to be an issue with the SDK.
To Reproduce
Steps to reproduce the behavior:
Which AWS service(s) are affected?
Expected behavior
The file from S3 should download.
Environment(please complete the following information):
Device Information (please complete the following information):
The text was updated successfully, but these errors were encountered: