Guides
Plan-enterprise-icon
Expo Application Services
API Reference

BuildProperties

expo-build-properties is a config plugin configuring the native build properties of your ios/Podfile.properties.json and android/gradle.properties directories during Expo Prebuild. This config plugin configures how Expo Prebuild generates the native ios and android folders and therefore cannot be used with projects that don't run npx expo prebuild (bare projects).

Platform Compatibility

Android DeviceAndroid EmulatoriOS DeviceiOS SimulatorWeb
Status-success-iconStatus-success-iconStatus-success-iconStatus-success-iconStatus-failed-icon

Installation

Terminal
→ npx expo install expo-build-properties

Configuration in app.json / app.config.js

Example app.json with config plugin

{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "compileSdkVersion": 31,
            "targetSdkVersion": 31,
            "buildToolsVersion": "31.0.0"
          },
          "ios": {
            "deploymentTarget": "13.0"
          }
        }
      ]
    ]
  }
}

Full configurable properties

Learn more from PluginConfigType

API

Methods

BuildProperties.withBuildProperties(config, props)

NameTypeDescription
configExpoConfig

ExpoConfig

propsPluginConfigType

Configuration for the config plugin

Config plugin to customize native Android or iOS build properties for managed apps

Returns

  • Undo-iconExpoConfig

Interfaces

PluginConfigType

Configuration for expo-build-properties

NameTypeDescription
android
(optional)
PluginConfigTypeAndroid-
ios
(optional)
PluginConfigTypeIos-

PluginConfigTypeAndroid

Config for Android native build properties

NameTypeDescription
buildToolsVersion
(optional)
stringOverride the default buildToolsVersion version number in build.gradle
compileSdkVersion
(optional)
numberOverride the default compileSdkVersion version number in build.gradle
enableProguardInReleaseBuilds
(optional)
booleanEnable Proguard (R8) in release builds to obfuscate Java code and reduce app size
extraProguardRules
(optional)
stringAppend custom Proguard rules to android/app/proguard-rules.pro
kotlinVersion
(optional)
stringOverride the default Kotlin version when building the app
minSdkVersion
(optional)
numberOverride the default minSdkVersion version number in build.gradle
packagingOptions
(optional)
PluginConfigTypeAndroidPackagingOptionsAGP PackagingOptions
targetSdkVersion
(optional)
numberOverride the default targetSdkVersion version number in build.gradle

PluginConfigTypeAndroidPackagingOptions

AGP PackagingOptions

NameTypeDescription
doNotStrip
(optional)
string[]Adds a doNotStrip pattern
exclude
(optional)
string[]Adds an excluded pattern
merge
(optional)
string[]Adds a merge pattern
pickFirst
(optional)
string[]Adds a first-pick pattern

PluginConfigTypeIos

Config for iOS native build properties

NameTypeDescription
deploymentTarget
(optional)
stringOverride the default iOS Deployment Target version in the following projects:
  • in CocoaPods projects
  • PBXNativeTarget with com.apple.product-type.application productType in the app project
useFrameworks
(optional)
'static' | 'dynamic'Enable use_frameworks! in Podfile
  • Message-iconAsk a question on the forums about BuildProperties
  • Github-iconView open bug reports for BuildProperties
  • Code-iconView source code for BuildProperties
  • Build-iconView package in npm Registry
  • Edit-iconEdit this page

Was this doc helpful?