8

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

Codeversed
  • 9,287
  • 3
  • 43
  • 42
AlienCoder
  • 101
  • 2
  • 6

2 Answers2

15

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

Nishanth Shankar
  • 1,966
  • 1
  • 14
  • 19
3

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.

Nicks
  • 16,030
  • 8
  • 58
  • 65