Skip to content
Latchkey

Expo "expo prebuild" failed (native generation) in CI

expo prebuild generates the native android/ and ios/ projects from app.json/app.config.js and applies config plugins. It fails when a plugin throws, a required field is missing, or an existing native directory conflicts with regeneration.

What this error means

A npx expo prebuild step fails with a plugin stack trace, "Cannot resolve config plugin", or an error that the native directory already exists and is dirty.

Expo CLI
Error: [ios.infoPlist]: withIosInfoPlistBaseMod: Cannot read properties of undefined (reading 'CFBundleURLTypes')
PluginError: Failed to resolve plugin for module "expo-camera"

Common causes

A config plugin threw during prebuild

A plugin in the plugins array errors because of a missing option or an incompatible plugin version.

A conflicting existing native directory

Committed or leftover android//ios/ directories conflict with regeneration unless prebuild is told to clean.

How to fix it

Run prebuild clean and read the plugin error

Regenerate native projects from scratch and find the failing plugin.

Terminal
npx expo prebuild --clean --platform android

Fix or pin the failing config plugin

  1. Identify the plugin named in the error.
  2. Provide its required options in app config, or pin a compatible version.
  3. Re-run prebuild.
app.json
{ "expo": { "plugins": [["expo-camera", { "cameraPermission": "Allow camera" }]] } }

How to prevent it

  • Use prebuild --clean in CI for deterministic native output.
  • Pin config plugin versions to ones matched to your Expo SDK.
  • Avoid committing generated native directories in a managed workflow.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →