Skip to main content

Build Configuration

The eas.json file in your project root defines how EAS Build compiles your app. This guide covers all configuration options for creating optimized builds.

eas.json Structure

eas.json

Top-Level Sections

  • cli: EAS CLI behavior and requirements
  • build: Build profiles for different environments
  • submit: App store submission configuration

CLI Configuration

Control EAS CLI behavior globally:
eas.json
Options:
  • version: Minimum required EAS CLI version
  • requireCommit: Require clean git state before builds
  • appVersionSource: "local" | "remote" - Where to get app version
  • promptToConfigurePushNotifications: Auto-configure push notifications

Build Profiles

Profiles define different build configurations for various use cases.

Default Profiles

When you run eas build:configure, these profiles are created:
eas.json

Profile Inheritance

Extend profiles to reduce duplication:
eas.json

Common Build Options

Options available for all platforms:

Distribution

  • "store": For app store submission (AAB for Android, IPA for iOS)
  • "internal": For internal distribution (APK for Android, Ad Hoc for iOS)

EAS Update Channel

Links builds to EAS Update channels for over-the-air updates.

Development Client

Builds a development client with expo-dev-client for debugging.

Environment Variables

Environment variables available during build and in the app runtime (if prefixed with EXPO_PUBLIC_).

Node.js Version

Specifies Node.js version for the build.

Credentials Source

  • "remote": Use credentials from EAS servers
  • "local": Use credentials from credentials.json

Resource Class

Options: "default" | "medium" | "large" - Larger classes provide more CPU/memory.

Cache Configuration

Control build caching to speed up subsequent builds.

Android-Specific Options

Configure Android builds:

Build Type

  • "app-bundle" (default): Creates AAB for Play Store
  • "apk": Creates APK for direct installation

Gradle Command

Custom Gradle command to run. Common commands:
  • :app:assembleRelease - Build release APK
  • :app:bundleRelease - Build release AAB
  • :app:assembleDebug - Build debug APK

Build Image

EAS Build image version (includes Android SDK, NDK, and tools).

Auto-Increment Version Code

Automatically increments versionCode for each build.

NDK Version

Specific Android NDK version for native code compilation.

Without Credentials

Build without code signing (for testing unsigned builds).

Complete Android Example

eas.json

iOS-Specific Options

Configure iOS builds:

Simulator Build

Builds for iOS Simulator (development only, no code signing needed).

Build Configuration

Xcode build configuration to use.

Scheme

Specifies which Xcode scheme to build.

Build Image

EAS Build image version (includes Xcode and related tools).

CocoaPods Version

Specific CocoaPods version for dependency management.

Auto-Increment Build Number

Automatically increments CFBundleVersion for each build.

Bundle Identifier

Override bundle identifier for this profile (useful for multi-flavor apps).

Enterprise Provisioning

For Apple Developer Enterprise Program accounts.

Complete iOS Example

eas.json

Multi-Platform Configurations

Configure both platforms with different settings:
eas.json

Environment Variables

Build-Time Variables

Available during the build process only:

Runtime Variables (EXPO_PUBLIC_)

Available in your app code:
Access in your app:

Secret Variables

For sensitive values, use EAS Secrets:
Secrets are available as environment variables during build:

Platform-Specific Environment Variables

eas.json

Advanced Configurations

Custom Build Functions

Run custom JavaScript during the build: Create eas-hooks/custom-build.js:
Reference in eas.json:

Monorepo Configuration

For monorepo projects:
eas.json

Build Variants (Android)

Build different flavors of your Android app:
eas.json

Multiple Build Configurations

Real-world example with multiple environments:
eas.json

Troubleshooting

Invalid eas.json

EAS CLI validates eas.json against a schema. Use proper JSON syntax and valid option values.
Common errors:
  • Missing commas between properties
  • Trailing commas in objects/arrays
  • Invalid property names
  • Wrong value types (string vs boolean)
Validate your eas.json:

Profile Not Found

Solution: Ensure profile exists in eas.json:
Profile must be defined:

Environment Variables Not Available

If process.env.EXPO_PUBLIC_API_URL is undefined:
  1. Ensure variable is prefixed with EXPO_PUBLIC_
  2. Rebuild the app (env vars are embedded at build time)
  3. Check eas.json has the variable in the correct profile

Inheritance Issues

When using extends, child profiles override parent values:
Result: Production has A=1 and B=3.

Next Steps