A config plugin that allows customizing native build properties during prebuild.
expo-build-properties
is a config plugin configuring the native build properties
of your android/gradle.properties and ios/Podfile.properties.json directories during Prebuild.
This config plugin configures how Prebuild command generates the native android and ios folders and therefore cannot be used with projects that don't runnpx expo prebuild
(bare projects).
-Â
npx expo install expo-build-properties
{
"expo": {
"plugins": [
[
"expo-build-properties",
{
"android": {
"compileSdkVersion": 34,
"targetSdkVersion": 34,
"buildToolsVersion": "34.0.0"
},
"ios": {
"deploymentTarget": "13.4"
}
}
]
]
}
}
export default {
expo: {
plugins: [
[
'expo-build-properties',
{
android: {
compileSdkVersion: 34,
targetSdkVersion: 34,
buildToolsVersion: '34.0.0',
},
ios: {
deploymentTarget: '13.4',
},
},
],
],
},
};
PluginConfigType
interface represents currently available configuration properties.
Parameter | Type | Description |
---|---|---|
config | ExpoConfig | Expo config for application. |
props | PluginConfigType | Configuration for the build properties plugin. |
Config plugin allowing customizing native Android and iOS build properties for managed apps.
ExpoConfig
Property | Type | Description |
---|---|---|
authentication(optional) | 'basic' | 'digest' | 'header' | The authentication scheme to use when accessing the Maven repository. |
credentials(optional) | AndroidMavenRepositoryCredentials | The credentials to use when accessing the Maven repository. May be of type PasswordCredentials, HttpHeaderCredentials, or AWSCredentials.
|
url | string | The URL of the Maven repository. |
Property | Type | Description |
---|---|---|
accessKey | string | - |
secretKey | string | - |
sessionToken(optional) | string | - |
Property | Type | Description |
---|---|---|
password | string | - |
username | string | - |
Interface representing extra CocoaPods dependency.
Property | Type | Description |
---|---|---|
branch(optional) | string | The git branch to fetch. See the |
commit(optional) | string | The git commit to fetch. See the |
configurations(optional) | string[] | Build configurations for which the pod should be installed. Example ['Debug', 'Release']
|
git(optional) | string | Use the bleeding edge version of a Pod. Example
This acts like to add this pod dependency statement:
|
modular_headers(optional) | boolean | Whether this pod should use modular headers. |
name | string | Name of the pod. |
path(optional) | string | Custom local filesystem path to add the dependency. Example ~/Documents/AFNetworking
|
podspec(optional) | string | Custom podspec path. Example
|
source(optional) | string | Custom source to search for this dependency. Example https://github.com/CocoaPods/Specs.git
|
tag(optional) | string | The git tag to fetch. See the |
testspecs(optional) | string[] | Test specs can be optionally included via the :testspecs option. By default, none of a Pod's test specs are included. Example ['UnitTests', 'SomeOtherTests']
|
version(optional) | string | Version of the pod. CocoaPods supports various versioning options. Example ~> 0.1.2
|
Interface representing base build properties configuration.
Property | Type | Description |
---|---|---|
android(optional) | PluginConfigTypeAndroid | Only for:  Android Interface representing available configuration for Android native build properties. |
ios(optional) | PluginConfigTypeIos | Only for:  iOS Interface representing available configuration for iOS native build properties. |
Interface representing available configuration for Android native build properties.
Property | Type | Description |
---|---|---|
buildToolsVersion(optional) | string | Override the default |
compileSdkVersion(optional) | number | Override the default |
enablePngCrunchInReleaseBuilds(optional) | boolean | Enable Default: true |
enableProguardInReleaseBuilds(optional) | boolean | Enable Proguard or R8 in release builds to obfuscate Java code and reduce app size. |
enableShrinkResourcesInReleaseBuilds(optional) | boolean | Enable |
extraMavenRepos(optional) | (string | AndroidMavenRepository)[] | Add extra maven repositories to all gradle projects. Takes an array of objects or strings.
Strings are passed as the This adds the following code to android/build.gradle:
By using an
|
extraProguardRules(optional) | string | Append custom Proguard rules to android/app/proguard-rules.pro. |
kotlinVersion(optional) | string | Override the Kotlin version used when building the app. |
manifestQueries(optional) | PluginConfigTypeAndroidQueries | Specifies the set of other apps that an app intends to interact with. These other apps are specified by package name, by intent signature, or by provider authority. |
minSdkVersion(optional) | number | Override the default |
networkInspector(optional) | boolean | Enable the Network Inspector. Default: true |
newArchEnabled(optional) | boolean |
|
packagingOptions(optional) | PluginConfigTypeAndroidPackagingOptions | Interface representing available configuration for Android Gradle plugin |
targetSdkVersion(optional) | number | Override the default |
useLegacyPackaging(optional) | boolean | Instructs the Android Gradle plugin to compress native libraries in the APK using the legacy packaging system. Default: false |
usesCleartextTraffic(optional) | boolean | Indicates whether the app intends to use cleartext network traffic. Default: false |
Interface representing available configuration for Android Gradle plugin PackagingOptions
.
Property | Type | Description |
---|---|---|
doNotStrip(optional) | string[] | Array of patterns for native libraries that should not be stripped of debug symbols. |
exclude(optional) | string[] | Array of patterns for native libraries that should be excluded from being packaged in the APK. |
merge(optional) | string[] | Array of patterns for native libraries where all occurrences are concatenated and packaged in the APK. |
pickFirst(optional) | string[] | Array of patterns for native libraries where only the first occurrence is packaged in the APK. |
Property | Type | Description |
---|---|---|
intent(optional) | PluginConfigTypeAndroidQueriesIntent[] | Specifies an intent filter signature. Your app can discover other apps that have matching
|
package(optional) | string[] | Specifies one or more apps that your app intends to access. These other apps might integrate with your app, or your app might use services that these other apps provide. |
provider(optional) | string[] | Specifies one or more content provider authorities. Your app can discover other apps whose content providers use the specified authorities.
There are some restrictions on the options that you can include in this |
Property | Type | Description |
---|---|---|
host(optional) | string | Specify a URI authority host that is handled |
mimeType(optional) | string | Specify a MIME type that is handled |
scheme(optional) | string | Specify a URI scheme that is handled |
Property | Type | Description |
---|---|---|
action(optional) | string | A string naming the action to perform. Usually one of the platform-defined values, such as |
category(optional) | string | string[] | Provides an additional way to characterize the activity handling the intent, usually related to the user gesture or location from which it's started. |
data(optional) | PluginConfigTypeAndroidQueriesData | A description of the data associated with the intent. |
Interface representing available configuration for iOS native build properties.
Property | Type | Description |
---|---|---|
ccacheEnabled(optional) | boolean | Enable C++ compiler cache for iOS builds. This speeds up compiling C++ code by caching the results of previous compilations. |
deploymentTarget(optional) | string | Override the default iOS "Deployment Target" version in the following projects:
|
extraPods(optional) | ExtraIosPodDependency[] | Add extra CocoaPods dependencies for all targets. This configuration is responsible for adding the new Pod entries to ios/Podfile. Example Creating entry in the configuration like below:
Will produce the following entry in the generated ios/Podfile:
|
networkInspector(optional) | boolean | Enable the Network Inspector. Default: true |
newArchEnabled(optional) | boolean |
|
privacyManifestAggregationEnabled(optional) | boolean | Enable aggregation of Privacy Manifests (
|
useFrameworks(optional) | 'static' | 'dynamic' | Enable |
Literal Type: multiple types
Acceptable values are: AndroidMavenRepositoryPasswordCredentials
| AndroidMavenRepositoryHttpHeaderCredentials
| AndroidMavenRepositoryAWSCredentials