> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/expo/expo/llms.txt
> Use this file to discover all available pages before exploring further.

# Build Properties

> Configure native build settings with expo-build-properties.

The `expo-build-properties` config plugin lets you customize iOS and Android build settings from `app.json` without editing native files directly.

## Installation

```bash theme={null}
npx expo install expo-build-properties
```

## Basic Usage

Add the plugin to your `app.json`:

```json title="app.json" theme={null}
{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "compileSdkVersion": 34,
            "targetSdkVersion": 34,
            "minSdkVersion": 24
          },
          "ios": {
            "deploymentTarget": "13.4"
          }
        }
      ]
    ]
  }
}
```

Then run prebuild:

```bash theme={null}
npx expo prebuild --clean
```

## Android Configuration

### SDK Versions

```json theme={null}
{
  "android": {
    "compileSdkVersion": 34,
    "targetSdkVersion": 34,
    "minSdkVersion": 24,
    "buildToolsVersion": "34.0.0"
  }
}
```

<table>
  <thead>
    <tr>
      <th>Property</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>compileSdkVersion</td>
      <td>SDK version to compile against</td>
      <td>34</td>
    </tr>

    <tr>
      <td>targetSdkVersion</td>
      <td>Target API level</td>
      <td>34</td>
    </tr>

    <tr>
      <td>minSdkVersion</td>
      <td>Minimum supported API level</td>
      <td>23</td>
    </tr>

    <tr>
      <td>buildToolsVersion</td>
      <td>Build tools version</td>
      <td>34.0.0</td>
    </tr>
  </tbody>
</table>

### NDK Version

```json theme={null}
{
  "android": {
    "ndkVersion": "26.1.10909125"
  }
}
```

Required for:

* React Native libraries with native C++ code
* Custom JNI modules
* Specific NDK features

### Kotlin Version

```json theme={null}
{
  "android": {
    "kotlinVersion": "1.9.20"
  }
}
```

### Gradle Properties

```json theme={null}
{
  "android": {
    "packagingOptions": {
      "pickFirst": [
        "**/libc++_shared.so"
      ]
    },
    "enableProguardInReleaseBuilds": true,
    "enableShrinkResourcesInReleaseBuilds": true
  }
}
```

### Memory Settings

```json theme={null}
{
  "android": {
    "minHeapSize": "512m",
    "maxHeapSize": "4g"
  }
}
```

### Multidex

```json theme={null}
{
  "android": {
    "usesCleartextTraffic": true,
    "useLegacyPackaging": false,
    "networkInspector": true
  }
}
```

### ProGuard/R8

```json theme={null}
{
  "android": {
    "enableProguardInReleaseBuilds": true,
    "enableShrinkResourcesInReleaseBuilds": true,
    "extraProguardRules": "-keep class com.myapp.** { *; }"
  }
}
```

## iOS Configuration

### Deployment Target

```json theme={null}
{
  "ios": {
    "deploymentTarget": "13.4"
  }
}
```

<Info>iOS 13.4+ is required for Expo SDK 50+</Info>

### Use Frameworks

```json theme={null}
{
  "ios": {
    "useFrameworks": "static"
  }
}
```

Options:

* `"static"`: Use static frameworks (recommended)
* `"dynamic"`: Use dynamic frameworks
* `null`: No frameworks (default)

Required for:

* Swift libraries
* Some CocoaPods dependencies

### Flipper

```json theme={null}
{
  "ios": {
    "flipper": false
  }
}
```

Disable Flipper for:

* Production builds
* Smaller binary size
* Faster builds

### New Architecture

```json theme={null}
{
  "ios": {
    "newArchEnabled": true
  },
  "android": {
    "newArchEnabled": true
  }
}
```

Enables React Native's new architecture (Fabric, TurboModules).

### Cocoapods

```json theme={null}
{
  "ios": {
    "cocoapodsInstallerCommand": "bundle exec pod install"
  }
}
```

## Common Configurations

### Minimum Example

```json title="app.json" theme={null}
{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "minSdkVersion": 24
          },
          "ios": {
            "deploymentTarget": "13.4"
          }
        }
      ]
    ]
  }
}
```

### Production Optimized

```json theme={null}
{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "compileSdkVersion": 34,
            "targetSdkVersion": 34,
            "minSdkVersion": 24,
            "buildToolsVersion": "34.0.0",
            "kotlinVersion": "1.9.20",
            "enableProguardInReleaseBuilds": true,
            "enableShrinkResourcesInReleaseBuilds": true
          },
          "ios": {
            "deploymentTarget": "13.4",
            "useFrameworks": "static",
            "flipper": false
          }
        }
      ]
    ]
  }
}
```

### Development Optimized

```json theme={null}
{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "minSdkVersion": 24,
            "enableProguardInReleaseBuilds": false,
            "networkInspector": true
          },
          "ios": {
            "deploymentTarget": "13.4",
            "flipper": true
          }
        }
      ]
    ]
  }
}
```

### New Architecture

```json theme={null}
{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "newArchEnabled": true,
            "minSdkVersion": 24
          },
          "ios": {
            "newArchEnabled": true,
            "deploymentTarget": "13.4",
            "useFrameworks": "static"
          }
        }
      ]
    ]
  }
}
```

### Monorepo Configuration

```json theme={null}
{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "minSdkVersion": 24,
            "packagingOptions": {
              "pickFirst": [
                "**/libc++_shared.so",
                "**/libfbjni.so"
              ]
            }
          },
          "ios": {
            "deploymentTarget": "13.4"
          }
        }
      ]
    ]
  }
}
```

## Platform-Specific Features

### Android Only

#### Jetpack Compose

```json theme={null}
{
  "android": {
    "kotlinVersion": "1.9.20",
    "compileSdkVersion": 34
  }
}
```

#### Material 3

```json theme={null}
{
  "android": {
    "compileSdkVersion": 34,
    "targetSdkVersion": 34
  }
}
```

### iOS Only

#### Swift Modules

```json theme={null}
{
  "ios": {
    "useFrameworks": "static"
  }
}
```

#### App Clips

```json theme={null}
{
  "ios": {
    "deploymentTarget": "14.0"
  }
}
```

## EAS Build Integration

### Build Profiles

```json title="eas.json" theme={null}
{
  "build": {
    "development": {
      "developmentClient": true,
      "android": {
        "buildType": "apk"
      }
    },
    "production": {
      "android": {
        "buildType": "aab"
      }
    }
  }
}
```

Combine with build properties:

```json title="app.json" theme={null}
{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "enableProguardInReleaseBuilds": true
          }
        }
      ]
    ]
  }
}
```

## Environment-Specific Configuration

### Using app.config.js

```javascript title="app.config.js" theme={null}
const IS_PRODUCTION = process.env.NODE_ENV === 'production';

export default {
  expo: {
    plugins: [
      [
        'expo-build-properties',
        {
          android: {
            minSdkVersion: 24,
            enableProguardInReleaseBuilds: IS_PRODUCTION,
            enableShrinkResourcesInReleaseBuilds: IS_PRODUCTION,
            networkInspector: !IS_PRODUCTION,
          },
          ios: {
            deploymentTarget: '13.4',
            flipper: !IS_PRODUCTION,
          },
        },
      ],
    ],
  },
};
```

### Multiple Configurations

```javascript title="app.config.js" theme={null}
const buildConfigs = {
  development: {
    android: {
      minSdkVersion: 24,
      networkInspector: true,
    },
    ios: {
      deploymentTarget: '13.4',
      flipper: true,
    },
  },
  production: {
    android: {
      minSdkVersion: 24,
      enableProguardInReleaseBuilds: true,
      enableShrinkResourcesInReleaseBuilds: true,
    },
    ios: {
      deploymentTarget: '13.4',
      flipper: false,
    },
  },
};

const config = buildConfigs[process.env.BUILD_ENV || 'development'];

export default {
  expo: {
    plugins: [['expo-build-properties', config]],
  },
};
```

## Troubleshooting

### Build Fails: SDK Version Mismatch

```
Error: The minSdkVersion should not be lower than 24
```

**Solution:**

```json theme={null}
{
  "android": {
    "minSdkVersion": 24
  }
}
```

### iOS Build Fails: Framework Not Found

```
Error: framework not found 'Pods_MyApp'
```

**Solution:**

```json theme={null}
{
  "ios": {
    "useFrameworks": "static"
  }
}
```

### Android Build Fails: Duplicate Classes

```
Error: Duplicate class found
```

**Solution:**

```json theme={null}
{
  "android": {
    "packagingOptions": {
      "pickFirst": [
        "**/libc++_shared.so"
      ]
    }
  }
}
```

### CocoaPods Install Fails

```
Error: [!] CocoaPods could not find compatible versions
```

**Solution:**

```bash theme={null}
# Update CocoaPods
cd ios
rm -rf Pods Podfile.lock
pod install --repo-update
```

## Best Practices

### 1. Use Specific Versions

```json theme={null}
// Good
{
  "android": {
    "compileSdkVersion": 34,
    "kotlinVersion": "1.9.20"
  }
}

// Bad
{
  "android": {
    "compileSdkVersion": "latest"
  }
}
```

### 2. Match Platform Targets

```json theme={null}
{
  "android": {
    "minSdkVersion": 24,  // Android 7.0+
    "targetSdkVersion": 34
  },
  "ios": {
    "deploymentTarget": "13.4"  // iOS 13.4+
  }
}
```

### 3. Optimize for Release

```json theme={null}
{
  "android": {
    "enableProguardInReleaseBuilds": true,
    "enableShrinkResourcesInReleaseBuilds": true
  },
  "ios": {
    "flipper": false
  }
}
```

### 4. Test After Changes

```bash theme={null}
# After modifying build properties
npx expo prebuild --clean
npx expo run:ios
npx expo run:android
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Prebuild" icon="folder" href="/development/prebuild">
    Learn about the prebuild workflow
  </Card>

  <Card title="Creating Builds" icon="hammer" href="/development/creating-builds">
    Build with custom properties
  </Card>

  <Card title="Monorepos" icon="folder-tree" href="/development/monorepos">
    Configure monorepo builds
  </Card>

  <Card title="Native Modules" icon="cube" href="/development/native-modules">
    Create native modules
  </Card>
</CardGroup>
