1

I'm trying to implement face detection in my Expo managed workflow project using the @infinitered/react-native-mlkit-face-detection library. I've followed the installation and setup steps, but I keep getting a "no module found" error. Below are the details of my implementation and the issue.

Steps I've Taken:
  1. Installed the library:

    npm install @infinitered/react-native-mlkit-face-detection

  2. Set up the Expo development client: I configured a development client for my Expo managed workflow project

  3. import { StyleSheet } from "react-native";
    import { FaceDetectionProvider } from "@infinitered/react-native-mlkit-face-detection";
    import FaceDetectionComponent from "./FaceDetectionComponent";
    export default function App() {
     return (
     <FaceDetectionProvider>
     <FaceDetectionComponent />
     </FaceDetectionProvider>
     );
    }
    const styles = StyleSheet.create({
     container: {
     flex: 1,
     backgroundColor: "#fff",
     alignItems: "center",
     justifyContent: "center",
     },
    });
    
  4. import { useFacesInPhoto } from "@infinitered/react-native-mlkit-face-detection";
    export default function FaceDetectionComponent() {
     // imageUri must be a local file URI
     const { faces, error, status } = useFacesInPhoto(
     "local_uri_of_your_image_uri"
     );
     if (error) {
     return <Text>Error: {error}</Text>;
     }
     return (
     <View>
     {faces.map((face) => (
     <View key={face.trackingId}>
     <Text>{JSON.stringify(face)}</Text>
     </View>
     ))}
     </View>
     );
    }
    
  5. Error Message: Error: Cannot find native module 'RNMLKitFaceDetection'

  6. Additional Information:

    1. Expo version: [52.0.41]

    2. React Native version: [0.76.7]

    3. @infinitered/react-native-mlkit-face-detection: [3.1.0]

asked Apr 2, 2025 at 13:58

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.