Skip to content
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

Error Domain=NSCocoaErrorDomain Code=257 "The file “FileName.mov” couldn’t be opened because you don’t have permission to view it." #118

Open
paulapithon opened this issue Nov 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@paulapithon
Copy link

Describe the bug
There's a crash happening when users doesn't have the appropriate viewing permission on iOS 18.

Error Domain=NSCocoaErrorDomain Code=257 "The file “FileName.mov” couldn’t be opened because you don’t have permission to view it." UserInfo={NSURL=file:///var/mobile/Media/.../FileName.mov#YnBsaXN0MDDRAQJfEBtSZWNvbW1lbmRlZEZvckltbWVyc2l2ZU1vZGUQAAgLKQAAAAAAAAEBAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAr, AVErrorFailedDependenciesKey=( "assetProperty_AssetType" ), NSUnderlyingError=0x3003d6700 {Error Domain=NSOSStatusErrorDomain Code=-12203 "(null)"}}

node_modules/react-native/React/Base/RCTUtils.m:503 - RCTJSErrorFromCodeMessageAndNSError
node_modules/react-native/React/Base/RCTModuleMethod.mm:370 - __41-[RCTModuleMethod processMethodSignature]_block_invoke_2.55
node_modules/react-native-create-thumbnail/ios/CreateThumbnail.m:75 - __58-[CreateThumbnail create:findEventsWithResolver:rejecter:]_block_invoke.52

To Reproduce
Steps to reproduce the behavior:

  1. Remove view photo library permission from app.
  2. Try to generate thumbnail.
  3. App crashes.

Version
react-native-create-thumbnail 2.0.0

Expected Results
App shouldn't crash, instead promise should be rejected so it will be handled gracefully on the App side.

Snack, code example, screenshot, or link to a repository

import {createThumbnail} from 'react-native-create-thumbnail';
const createdThumbnail = await createThumbnail({
      url: item.url,
});
@paulapithon paulapithon added the bug Something isn't working label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant