Cannot access CameraRoll - undefined is not an object(evaluating RCTCameraRollManager.getPhotos)
I cannot use 'CameraRoll' anymore. So as per some suggestions on StackOverFlow I downloaded RCTCameraRoll.xcodeproj and added it under libraries. Then, I located libRCTCameraRoll.a under 'Products' and linked that under 'Build Phases'. And still nothing.
Am I doing something wrong? Just using CameraRoll component before used to do the trick but not anymore.

Hey vinu123, thanks for reporting this issue!
React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
- If this is a feature request or a bug that you would like to be fixed by the team, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
- If you don't know how to do something or not sure whether some behavior is expected or a bug, please ask on StackOverflow with the tag
react-nativeor for more real time interactions, ask on Discord in the #react-native channel. - We welcome clear issues and PRs that are ready for in-depth discussion; thank you for your contributions!
Make sure you add libRCTCameraRoll.a to the Linked Frameworks and Libraries section of your main Xcode project not the RCTCameraRoll.xcodeproj subproject. Also, you can add the RCTCameraRoll.xcodeproj project from node_modules/react-native/LibrariesCameraRoll rather than downloading it from the repo. That way its matched to your React Native version.
Thanks so much man. That was pretty neat @asamiller
@vinu123 if your issue is fixed, please consider closing this to help us keep the issue tracker clean! :)
Just tried to use CameraRoll as indicated here, with React Native v0.20:
http://facebook.github.io/react-native/releases/0.20/docs/cameraroll.html#content
and had problems on iOS, android is working as expected. The problem on iOS is that, although, in Build Settings / Header Search Paths there is an entry in the form of: $(SRCROOT)/../node_modules/react-native/React which is marked recursive, the RCTCameraRoll.xcodeproj is not linked with your app, which consequently leads to libRCTCameraRoll.a not being in the Linked Frameworks and Libraries section. After connecting this manually, everything behaves as expected.
Would the proper solution here be that we add an entry to Build Settings / Header Search Paths, to the Libraries folder, same as it is to the React folder, or do we do this manually for each native functionality that we use in our project?
Also, it would be nice if this can be added somewhere in the documentation.
where can I get libRCTCameraRoll.a? I can't find it!!
You should be able to find it in the Libraries folder of React Native, once you install it via npm, so something like {projectDir}/node_modules/react-native/Libraries/... {check out Camera Roll, and Image directories}. Don't forget to link the corresponding projects also.
I don't see any .a files.

Nevermind. Found it. It's within the xcode project, like so:

See https://facebook.github.io/react-native/docs/linking-libraries-ios.html manual step 2
I have the same problem, any solution in this page does not work
Error screen:

What i found at node_modules/react-native/Libraries/CameraRoll/CameraRoll.js:291

What i have done so far:
-
Added Header Search Paths
$(SRCROOT)/../node_modules/react-native/Libraries/CameraRoll -
Linking is properly done, confirmed it:

-
At my component, both
console.log(CameraRoll)andconsole.log(CameraRoll.getPhotos)have their proper object, which means no errors there. -
Already added
<key>NSPhotoLibraryUsageDescription</key>and its<string>description atInfo.plist -
Deleted and re-installed the app
-
run
yarn start --reset-cache -
Tried on both simulator and device
The error still persist! 🤔 Using React Native v0.51.0
EDIT
Just tried to console.log(RCTCameraRollManager) at node_modules/react-native/Libraries/CameraRoll/CameraRoll.js
Results

So basically the problem comes from not recognising the CameraRollManager even if i use
require('NativeModules').CameraRollManager
because something has to do with the linking.
Same goes at #5878
Fixed it
After upgrading react-native to v0.53.0 :
I was using the component react-native-camera and it was creating a project for itself called
RCTCamera.xcodeproj with linked library file called libRCTCamera.a
While the react native build-in component has project name
RCTCameraRoll.xcodeproj with linked library file called libRCTCameraRoll.a
Both of those created a confusion because of names nearly the same.
@a3diti i think you need to run react-native run-ios again.
I have had the same issue and I'm using react-native-camera with RNCamera.xcodeproj.
Based on information from @a3diti, I just add RCTCameraRoll.xcodeproj again from node_modules/react-native/Libraries/CameraRoll and libRCTCameraRoll.a to my Link binary with libraries
Thanks