React native setup

From event4u-app/agent-config · View interactive version

React native setup is an AI agent skill from the GitHub repository event4u-app/agent-config. Use when setting up React Native or Expo dev environments — Xcode, Android Studio, CocoaPods, EAS, Metro, New Architecture — even when the user just says 'my RN build won't start'.

How to use this skill

Skill file

react-native-setup

When to use

Cross-links: mobile-e2e-strategy (Detox / Appium / Maestro selection),

docs/guidelines/agent-infra/ios-simulator-guide.md (iOS simulator decision matrix).

Assess current setup before changing anything

Before installing or upgrading anything, inspect what's already there — modifying a working toolchain blindly is the most common source of wasted hours.

  1. Read package.json — RN version, Expo SDK, scripts, native dependencies.
  2. Check ios/Podfile and ios/Podfile.lock — CocoaPods version, deployment target, RCT_NEW_ARCH_ENABLED flag.
  3. Check android/build.gradle and android/gradle.properties — Gradle version, compile/target SDK, newArchEnabled, NDK version.
  4. Verify host tools — node --version, xcodebuild -version, sdkmanager --list_installed, pod --version, watchman --version.
  5. Check for an existing .nvmrc, .tool-versions, or Brewfile — honour the project's pinned versions over global ones.
  6. Read project README and CONTRIBUTING — many RN repos document one-time setup quirks (Apple Silicon Rosetta, Hermes flags, EAS profile names).

Procedure

  1. Identify the target stack — RN CLI vs Expo, target SDK, supported OS, monorepo or single-package.
  2. Verify prerequisites — Node, package manager, Watchman, platform SDKs (see matrix below).
  3. Configure platform tooling — Xcode + CocoaPods (iOS) or Android Studio + SDK 34/35 (Android).
  4. Install project dependencies — npm/yarn/pnpm/bun install, then pod install for iOS.
  5. Run a smoke build — npm run ios / npm run android / npx expo start.
  6. Validate — app launches, fast refresh works, Metro bundler runs without warnings.
  7. On failure — apply the matching pattern from "Common setup issues" below.

Prerequisites

Node.js

engines.node. None: a release still in Active LTS or Maintenance, with

the date you read the schedule. A version named here instead expired

unnoticed once already, which is why it is no longer named here.

used to claim, and were not re-checked with this bullet.

corepack enable && corepack prepare yarn@stable --activate.

Xcode (macOS, iOS)

Android Studio

Watchman

Platform setup

iOS

Android

Metro bundler

EAS Build (Expo)

Common setup issues

"Command not found"

SDK not found

Pod install failures

Build failures

New Architecture issues

Quick verification

node --version          # 20+ (22 LTS preferred)
npm --version
xcodebuild -version     # 16.1+
pod --version           # 1.15+
adb --version
emulator -version
watchman version
eas --version           # Expo only
echo $ANDROID_HOME      # non-empty

Quick commands

Create / run RN CLI project

npx @react-native-community/cli init MyProject
cd MyProject
RCT_NEW_ARCH_ENABLED=1 pod install --project-directory=ios
npm start                # Metro
npm run ios              # in a second terminal
npm run android          # in a third terminal

Create / run Expo project

npx create-expo-app@latest MyProject
cd MyProject
npx expo start
# Custom native code → dev client:
npx expo install expo-dev-client
eas build --profile development --platform ios
eas build --profile development --platform android

Simulator / emulator

xcrun simctl list devices
xcrun simctl boot "iPhone 16 Pro"
emulator -list-avds
emulator -avd Pixel_8_API_35

Reset everything

watchman watch-del-all
npx react-native start --reset-cache    # RN CLI
npx expo start --clear                  # Expo

Pro tips

  1. Shell profile — add SDK paths once, reload once:

```bash

export ANDROID_HOME=$HOME/Library/Android/sdk

export PATH=$PATH:$ANDROID_HOME/emulator

export PATH=$PATH:$ANDROID_HOME/platform-tools

export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin

```

  1. EAS minimum eas.json — development (dev client + internal), preview (internal), production (defaults).
  2. Hermes — RN ≥ 0.70 ships Hermes by default; verify with global.HermesInternal !== undefined at runtime.
  3. Health check — a single shell function running the verification block above catches 80 % of "it doesn't build" reports.

Version compatibility (2025)

| Component | Minimum | Recommended | Notes |

|---|---|---|---|

| Node.js | 20.x | 22 LTS | Node 18 EOL April 2025 |

| React Native | 0.76 | 0.83 | New Architecture default since 0.76 |

| React | 18.3 | 19.2 | Activity, useEffectEvent |

| Expo SDK | 52 | 54 | Native tabs, Liquid Glass |

| Xcode | 16.1 | 26 | iOS 26 required for Liquid Glass |

| Android SDK | 34 | 35 | Edge-to-edge support |

| CocoaPods | 1.14 | 1.15+ | New Architecture compatibility |

| Gradle | 8.6 | 8.10+ | K2 compiler support |

Output format

  1. A short setup plan keyed off the target stack (RN CLI vs Expo, iOS vs Android vs both).
  2. Concrete shell commands the user can paste — no placeholders unless flagged <…>.
  3. A verification block confirming the toolchain is healthy before any feature work.

Auto-trigger keywords

Gotcha

Do NOT

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.