Skip to main content

Installation

To integrate React Native MediaPipe into your project, follow these simple steps.

Requirements

  • Gradle minimum SDK 24 or higher
  • Android-SDK Version 26 or higher
  • iOS 12 or higher
  1. Open Terminal or Command Prompt: Open your terminal or command prompt application.
  2. Navigate to Your Project Directory: Navigate to your React Native project directory.
  3. Install React Native MediaPipe: Run the following command to install React Native MediaPipe and its dependencies:

Using npm

npm install react-native-mediapipe react-native-vision-camera react-native-worklets-core

Using yarn

yarn add react-native-mediapipe react-native-vision-camera react-native-worklets-core
  1. Configuring Babel: Navigate to the 'babel.config.js' file and add:
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: [['react-native-worklets-core/plugin']],
};
  1. Configuring Gradle: Navigate to the 'android/build.gradle' file and change minSdkVersion to 24
warning

Gradle minimum SDK must be 24 or higher to run

buildscript {
ext {
...
minSdkVersion = 24
...
}
...
}

Configuring to your Operating System

  1. Give Permissions: Navigate to your AndroidManifest.xml file and add:

<uses-permission android:name="android.permission.CAMERA" />

<!-- optionally, if you want to record audio: -->

<uses-permission android:name="android.permission.RECORD_AUDIO" />