React-native-camera error: undefined is not an object (evaluating 'CameraManager.Aspect')

#1

I cannot seem to get react-native-camera working in Expo.

The error originates on line 62 of react-native-camera index.js which is calling NativeModules.CameraManager. Does this have something to do with expo not having access to some native apis?

Steps already taken:

  • react-native link react-native-camera
  • watchman watch-del-all
  • rm -rf node_modules && npm install
  • rm -fr $TMPDIR/react-*
  • npm start – --reset-cache
  • Restarting the build

I also created a regular react native app via react-native init and was able to properly set up react-native-camera without any issues.

Any help would be appreciated. Thanks!

#2

You can’t use your own native modules with Expo unless you eject to ExpoKit. Did you do that here?
Here is a guide to that if you need it. https://docs.expo.io/versions/v16.0.0/guides/detach.html#content

There is a basic camera view built into Expo that you can use. It’s documented here: https://docs.expo.io/versions/v16.0.0/sdk/imagepicker.html#expoimagepickerlaunchcameraasyncoptions

We are working on more customizable stuff as well but this is what we have for now.

1 Like
#3

+1 same issue for me.

#4

This is the number 1 thing I’m looking forward to!

You guys did an awesome thing simplifying React Native, especially those pesky notification.

Good luck Greg! God Speed!

#6

Take a look at https://docs.expo.io/versions/latest/sdk/camera.html.

2 Likes