expo-build-properties plugin lets you configure native build settings for iOS and Android without writing custom config plugins. It’s the recommended way to set SDK versions, optimization flags, and other build properties.
Installation
Basic usage
Add the plugin to yourapp.json or app.config.js:
app.json
Android properties
SDK versions
Configure Android SDK versions:pluginConfig.ts
Kotlin version
Set the Kotlin version:Optimization settings
Enable code minification and resource shrinking:shrinkResources to remove unused resources. Must be used with enableMinifyInReleaseBuilds.
enablePngCrunchInReleaseBuilds (default: true) - Optimize PNG files. Disable if you do your own PNG optimization.
ProGuard rules
Add custom ProGuard rules:Packaging options
Configure native library packaging:pluginConfig.ts
Network configuration
Allow cleartext HTTP traffic:true. For Android 9+, the default is false.
Maven repositories
Add custom Maven repositories:basic- HTTP Basic authenticationdigest- HTTP Digest authenticationheader- Custom HTTP headers
pluginConfig.ts
Build architectures
Specify which ABIs to build:["armeabi-v7a", "arm64-v8a", "x86", "x86_64"]
Building fewer architectures reduces app size but limits device compatibility.
Manifest queries
Specify apps your app intends to interact with (Android 11+):Legacy packaging
Use legacy native library packaging:Day/Night theme
Enable dark mode support:Network Inspector
Control Network Inspector:true
Bundle compression
Enable JavaScript bundle compression:Exclusive Maven mirror
Use a single Maven repository for all dependencies:iOS properties
Deployment target
Set minimum iOS version:- CocoaPods projects
- Xcode project build settings
- All native targets
Use frameworks
Configure CocoaPods to use frameworks:"static"- Use static frameworks"dynamic"- Use dynamic frameworksundefined- Use default (static libraries)
use_frameworks! :linkage => :static to Podfile.
Force static linking
Force specific pods to link statically:Extra CocoaPods
Add additional CocoaPods:pluginConfig.ts
Ccache
Enable C++ compiler cache:Privacy manifest aggregation
Aggregate Privacy Manifests from CocoaPods:PrivacyInfo.xcprivacy files from pods into a single manifest.
Network Inspector
Control Network Inspector:true
Shared properties
These properties can be set at the top level or per-platform. Platform-specific values take precedence.Build React Native from source
pluginConfig.ts
React Native release level
"stable"(default)"canary""experimental"
Use Hermes V1
Enable experimental Hermes V1 engine:pluginConfig.ts
Complete configuration example
app.json
Validation
The plugin validates your configuration:pluginConfig.ts
Using in custom plugins
Import types from expo-build-properties:Debugging
Enable debug output:Best practices
1. Use minimal SDK versions
Don’t set SDK versions higher than necessary:2. Enable optimizations for release
3. Use environment variables for credentials
4. Test build property changes
Always test after changing build properties:5. Document custom settings
Add comments in app.config.js:app.config.js
Next steps
- Modifying native projects - More native customization
- iOS Entitlements - iOS capabilities
- Android Permissions - Android permissions