DEV Community

gie3d
gie3d

Posted on

1

Expo Camera set up in Bare workflow

Found a difficulty when I tried to eject an app with expo-camera from Expo Managed into Bare workflow. Our team managed to solve this problem and I blog it as a reference

From my experience, it's simple to use most of expo component in the Bare workflow until I come across expo-camera. I expected it to be managed by react-native-unimodules. However, thing wasn't that simple. This is the error I observed during gradle build:

ERROR: Failed to resolve: com.google.android:cameraview:1.0.0
Show in Project Structure dialog
Affected Modules: app
Enter fullscreen mode Exit fullscreen mode

This can be fixed by applying this into build.gradle

allprojects {
    repositories {
        ...your code
        maven {
            // expo-camera bundles a custom com.google.android:cameraview
            url "$rootDir/../node_modules/expo-camera/android/maven"
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

and you're good to go!

The hardest part is the above hasn't been stated in the component reference. But it's located deeply in its github repo here https://github.com/expo/expo/tree/sdk-39/packages/expo-camera

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay