question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CameraRoll.getPhotos breaks with assetType = photos

See original GitHub issue

Description

I’m using this library: https://github.com/jeanpan/react-native-camera-roll-picker/blob/master/index.js under the hood it calls the cameraRoll api. When I pass in ‘All’ for the asset type, it works. When I use ‘Photos’ as the type, the app crashes inside of the RCTCameraRoll code:

screen shot 2017-04-26 at 10 11 19 am

Reproduction Steps and Sample Code

I was going to try and add an example on expo, but it won’t work unless you have more than just photos in your camera roll. To reproduce, just call CameraRoll.getPhotos({assetType: 'Photos'})

  • React Native version: 0.43.4
  • Platform: iOS
  • Development Operating System: MacOS
  • Dev tools: Xcode 8.3.2, iOS 10.3.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pentarexcommented, Jan 11, 2018

I am having the same issue with CameraRoll from RN.

CameraRoll.getPhotos({
            first: 20,
            groupTypes: 'All',
            assetType: 'Photos'
        }).then(r => {
            console.log(r);
            
        }).catch((err) => {
             console.log('gallery', err);
        });

The thing is that some photo for some reason filename is missing (maybe iCloud). And I think its crashing because of that (not completely sure), but as I see @zackify also his filename was nil.

It doesn’t fail under the simulator, but on my real device, where most of my photos are on iCloud.

0reactions
pentarexcommented, Mar 2, 2018

@facuescobar except the thing that I’ve told you, I have no other clue. Also they are using old framework for the Gallery and this is taking the pictures from iTunes, it has some strange ordering, if you want to test out this one be my guest https://github.com/pentarex/react-native-gallery-manager

Read more comments on GitHub >

github_iconTop Results From Across the Web

camera roll - React Native CameraRoll getPhotos optimization
I want to get every photo off a user's device by creating a while loop until I have every photo. Is it better...
Read more >
CameraRoll - React Native Archive
getPhotos (params);. Returns a Promise with photo identifier objects from the local camera roll of the device matching shape defined by getPhotosReturnChecker ....
Read more >
Cameraroll Picker for Changing The Album Name and Adding ...
(Default: Album); assetType : The asset type, one of 'Photos', 'Videos' or 'All'. (Default: Photos); selected : Already be selected images array.
Read more >
@react-native-community/cameraroll - npm
CameraRoll.getPhotos(params);. Returns a Promise with photo identifier objects from the local camera roll of the device matching shape defined ...
Read more >
React Native v0.59.x released
... CameraRoll's getPhotos now supports assetType: "All" to let users pick from video and photos simultaneously (54534e7 by @kesha-antonov) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found