What is expo-build-properties?
The expo-build-properties package allows you to customize native build properties for your Expo project. This includes modifying Android and iOS build settings directly from your JavaScript code, making it easier to manage and automate build configurations.
What are expo-build-properties's main functionalities?
Modify Android build properties
This feature allows you to set various Android build properties such as compileSdkVersion, targetSdkVersion, minSdkVersion, and buildToolsVersion. This is useful for ensuring your app is built with the correct SDK versions.
{
"android": {
"compileSdkVersion": 30,
"targetSdkVersion": 30,
"minSdkVersion": 21,
"buildToolsVersion": "30.0.3"
}
}
Modify iOS build properties
This feature allows you to set iOS build properties such as deploymentTarget and useFrameworks. This is useful for configuring the minimum iOS version your app supports and whether to use static or dynamic frameworks.
{
"ios": {
"deploymentTarget": "12.0",
"useFrameworks": "static"
}
}
Custom Gradle properties
This feature allows you to set custom Gradle properties for your Android build. This is useful for enabling AndroidX and Jetifier, which are often required for modern Android development.
{
"android": {
"gradleProperties": {
"android.useAndroidX": "true",
"android.enableJetifier": "true"
}
}
}
Custom Xcode build settings
This feature allows you to set custom Xcode build settings for your iOS project. This is useful for specifying the Swift version and enabling or disabling Bitcode.
{
"ios": {
"buildSettings": {
"SWIFT_VERSION": "5.0",
"ENABLE_BITCODE": "NO"
}
}
}
Other packages similar to expo-build-properties
react-native-config
react-native-config allows you to manage environment-specific configurations for your React Native app. It provides a way to define and access environment variables in your JavaScript code, but it does not offer the same level of native build property customization as expo-build-properties.
react-native-build-config
react-native-build-config is another package that allows you to manage build configurations for React Native projects. It provides a way to define build-specific settings, but it is less integrated with Expo and does not offer the same level of customization for native build properties.
react-native-ultimate-config
react-native-ultimate-config is a package that provides a unified way to manage configuration settings for React Native apps. It supports both JavaScript and native code configurations, but it is more focused on environment variables and less on native build properties compared to expo-build-properties.
expo-build-properties
expo-build-properties
is a config plugin to customize native build properties when using npx expo prebuild
.
API documentation
Installation
npx expo install expo-build-properties
Add plugin to app.json
. For example:
{
"expo": {
"plugins": [
[
"expo-build-properties",
{
"android": {
"compileSdkVersion": 31,
"targetSdkVersion": 31,
"buildToolsVersion": "31.0.0"
},
"ios": {
"deploymentTarget": "13.0"
}
}
]
]
}
}
Contributing
Contributions are very welcome! Please refer to guidelines described in the [contributing guide][../../contributing.md].