# PrivacySandboxSdkExtension

# PrivacySandboxSdkExtension

[View Source](https://cs.android.com/search?q=file:com/android/build/api/dsl/PrivacySandboxSdkExtension.kt+class:com.android.build.api.dsl.PrivacySandboxSdkExtension)  
Added in 7.4.1  

<br />

```
@Incubating
interface PrivacySandboxSdkExtension
```

<br />

*** ** * ** ***

## Summary

|                             ### Public functions                             |
|------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) [bundle](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#bundle(kotlin.Function1))`(action: `[PrivacySandboxSdkBundle](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkBundle)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)`                                                                            |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) [optimization](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#optimization(kotlin.Function1))`(action: `[PrivacySandboxSdkOptimization](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkOptimization)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` Specifies options for the R8/D8 optimization tool. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) [signingConfig](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#signingConfig(kotlin.Function1))`(action: `[SigningConfig](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/SigningConfig)`?.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)`                                                                                 |

|                                                                                                                           ### Public properties                                                                                                                           |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                                                                                                                                                          | [buildToolsVersion](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#buildToolsVersion()) Specifies the version of the[SDK Build Tools](https://developer.android.com/studio/releases/build-tools.html)to use when building your project. |
| [PrivacySandboxSdkBundle](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkBundle)                                                                                                                                 | [bundle](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#bundle())                                                                                                                                                                       |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?`                                                                                                                                                                                             | [compileSdk](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#compileSdk()) Specifies the API level to compile your project against.                                                                                                      |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?`                                                                                                                                                                                             | [compileSdkExtension](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#compileSdkExtension())                                                                                                                                             |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`                                                                                                                                                                                       | [compileSdkPreview](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#compileSdkPreview())                                                                                                                                                 |
| [MutableMap](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)`<`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`>` | [experimentalProperties](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#experimentalProperties())                                                                                                                                       |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?`                                                                                                                                                                                             | [minSdk](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#minSdk())                                                                                                                                                                       |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`                                                                                                                                                                                       | [minSdkPreview](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#minSdkPreview())                                                                                                                                                         |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`                                                                                                                                                                                       | [namespace](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#namespace())                                                                                                                                                                 |
| [PrivacySandboxSdkOptimization](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkOptimization)                                                                                                                     | [optimization](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#optimization()) Specifies options for the R8/D8 optimization tool.                                                                                                        |
| [SigningConfig](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/SigningConfig)                                                                                                                                                     | [signingConfig](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#signingConfig())                                                                                                                                                         |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?`                                                                                                                                                                                             | [targetSdk](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkExtension#targetSdk())                                                                                                                                                                 |

## Public functions

### bundle

Added in 7.4.1  

```
@Incubating
fun bundle(action: PrivacySandboxSdkBundle.() -> Unit): Unit
```  

### optimization

Added in 8.4.0  

```
@Incubating
fun optimization(action: PrivacySandboxSdkOptimization.() -> Unit): Unit
```

Specifies options for the R8/D8 optimization tool.

For more information about the properties you can configure in this block, see[PrivacySandboxSdkOptimization](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkOptimization).  

### signingConfig

Added in 8.1.0  

```
@Incubating
fun signingConfig(action: SigningConfig?.() -> Unit): Unit
```  

## Public properties

### buildToolsVersion

Added in 7.4.1  

```
var buildToolsVersion: String
```

Specifies the version of the[SDK Build Tools](https://developer.android.com/studio/releases/build-tools.html)to use when building your project.

By default, the plugin uses the minimum version of the build tools required by the[version of the plugin](https://developer.android.com/studio/releases/gradle-plugin.html#revisions)you're using. To specify a different version of the build tools for the plugin to use, specify the version as follows:  

```text
android {
    // Specifying this property is optional.
    buildToolsVersion "26.0.0"
}
```

For a list of build tools releases, read[the release notes](https://developer.android.com/studio/releases/build-tools.html#notes).

Note that the value assigned to this property is parsed and stored in a normalized form, so reading it back may give a slightly different result.  

### bundle

Added in 7.4.1  

```
val bundle: PrivacySandboxSdkBundle
```  

### compileSdk

Added in 7.4.1  

```
var compileSdk: Int?
```

Specifies the API level to compile your project against. The Android plugin requires you to configure this property.

This means your code can use only the Android APIs included in that API level and lower. You can configure the compile sdk version by adding the following to the`android`block:`compileSdk = 26`.

You should generally[use the most up-to-date API level](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)available. If you are planning to also support older API levels, it's good practice to[use the Lint tool](https://developer.android.com/studio/write/lint.html)to check if you are using APIs that are not available in earlier API levels.

The value you assign to this property is parsed and stored in a normalized form, so reading it back may return a slightly different value.  

### compileSdkExtension

Added in 7.4.1  

```
var compileSdkExtension: Int?
```  

### compileSdkPreview

Added in 7.4.1  

```
var compileSdkPreview: String?
```  

### experimentalProperties

Added in 8.2.0  

```
val experimentalProperties: MutableMap<String, Any>
```  

### minSdk

Added in 7.4.1  

```
var minSdk: Int?
```  

### minSdkPreview

Added in 7.4.1  

```
var minSdkPreview: String?
```  

### namespace

Added in 7.4.1  
Deprecated in 7.4.1  

```
var namespace: String?
```  

### optimization

Added in 8.4.0  

```
val optimization: PrivacySandboxSdkOptimization
```

Specifies options for the R8/D8 optimization tool.

For more information about the properties you can configure in this block, see[PrivacySandboxSdkOptimization](https://developer.android.com/reference/tools/gradle-api/8.7/com/android/build/api/dsl/PrivacySandboxSdkOptimization).  

### signingConfig

Added in 8.1.0  

```
val signingConfig: SigningConfig
```  

### targetSdk

Added in 8.7.3  

```
var targetSdk: Int?
```