expo-camera is causing build fail on devices that have not granted permission

Please provide the following:

  1. SDK Version: 46
  2. Platforms(Android/iOS/web/all): android
  3. “expo-camera”

When running npx expo run:android I am getting a build error on devices that have not granted permission. I’m not sure if the warning is involved, it also only happens when I import expo-camera but expo-linear-gradient is not called in the same component.

On one device I was able to grant permission and now expo builds fine on that device.

WARN The native view manager required by name (ExponentCamera) from NativeViewManagerAdapter isn’t exported by expo-modules-core. Views of this type may not render correctly. Exported view managers: [ExpoLinearGradient].
ERROR TypeError: Cannot read property ‘Type’ of undefined, js engine: hermes
ERROR Invariant Violation: “main” has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and AppRegistry.registerComponent wasn’t called., js engine: hermes

I’m very new to building mobile apps so not sure what I should share since Expo handled most of the files. I did add this to build.gradle

maven {
// expo-camera bundles a custom com.google.android:cameraview
url “$rootDir/…/node_modules/expo-camera/android/maven”

and made sure every file said expo-sdk version 46.0.0

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.