RNRepo Installation
Prerequisites
- React Native New Architecture enabled.
- React Native version:
0.77.3,0.78.3,0.79.7, or>= 0.80.0.
Expo Prebuild (CNG)
For projects that use expo prebuild to generate native directories.
1. Install the plugin
npx expo install @rnrepo/expo-config-pluginIn a monorepo with hoisted node_modules, also install the build tools explicitly:
npx expo install @rnrepo/build-tools2. Register in app.config.ts (or app.json / app.config.js)
{
"expo": {
"plugins": [
+ "@rnrepo/expo-config-plugin"
]
}
}3. Add .fingerprintignore (if using Expo Fingerprint / EAS)
**/.rnrepo-cacheThat's it — run expo prebuild and the plugin configures both Android and iOS automatically.
Standard React Native (manual native folders)
1. Install build tools
npm install @rnrepo/build-tools@latest2. Android — edit android/build.gradle
Add the RNRepo Gradle plugin to the buildscript.dependencies block:
buildscript {
dependencies {
// ... existing classpath entries
+ def rnrepoDir = new File(
+ providers.exec {
+ workingDir(rootDir)
+ commandLine("node", "--print", "require.resolve('@rnrepo/build-tools/package.json')")
+ }.standardOutput.asText.get().trim()
+ ).getParentFile().absolutePath
+ classpath fileTree(dir: "${rnrepoDir}/gradle-plugin/build/libs", include: ["prebuilds-plugin.jar"])
}
}3. Android — edit android/app/build.gradle
Apply the plugin after the existing apply plugin lines:
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
+ apply plugin: "org.rnrepo.tools.prebuilds-plugin"4. iOS — edit ios/Podfile
Add the require at the very top and a post_install hook inside your target:
+ require Pod::Executable.execute_command('node', ['-p',
+ 'require.resolve(
+ "@rnrepo/build-tools/cocoapods-plugin/lib/plugin.rb",
+ {paths: [process.argv[1]]},
+ )', __dir__]).strip
# ... rest of Podfile
target 'YourProjectName' do
post_install do |installer|
# ... existing post_install hooks
+ rnrepo_post_install(installer)
end
endVerifying the setup
Android
Run npm run android and look for RNRepo log lines during Gradle preparation:
[📦 RNRepo] Found the following supported prebuilt packages:
📦 react-native-safe-area-context@5.7.0If working: no compileDebugKotlin tasks for substituted packages.
iOS
Run a build and look for RNRepo log lines during pod install:
[📦 RNRepo] Total React Native dependencies detected: 1
[📦 RNRepo] ⬇ Downloaded from Maven...
[📦 RNRepo] • react-native-safe-area-context
[📦 RNRepo] Added build phase to <package-name>If working: Xcode compiles only JSI glue code (e.g., safeareacontextJSI-generated.cpp), not library source files.