Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

undefined is not an object (evaluating 'RCTCameraRollManager.getPhotos')

I want to use CameraRoll to get a picture but broken by red-screen.

So I tried following:

//print: undefined
console.log(RCTCameraRollManager); 

red-screen

like image 809
AlienCoder Avatar asked Oct 23 '15 02:10

AlienCoder


2 Answers

Please check if RCTCameraRoll is added to your library. If not you must link the library to from node_module/react-native/Libraries/CameraRoll

There is great guide to linking libraries to react-native in the react-native docs https://facebook.github.io/react-native/docs/linking-libraries-ios.html#content

like image 109
Nishanth Shankar Avatar answered Nov 20 '22 10:11

Nishanth Shankar


Being an android developer, I was struggling to use the react-native camera roll. I was able to find it in following location :-

node_module/react-native/Libraries/CameraRoll

And while linking the library using "react-native link cameraRoll , I was facing the following error:-

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/react-native-cameraroll

So we need to manually link it as follows:

open your Xcode.Then from the node_module/react-native/Libraries/CameraRoll, drag the RCTCameraRoll.xcodeproj into the left side pane of Libraries folder. Now go to Project - general --"Linked frameworks and libraries" add (+) the folder named libRCTCameraRoll.a.

Re-install and it works.

like image 29
Nicks Avatar answered Nov 20 '22 11:11

Nicks