# DexPackagingOptions

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


```
interface DexPackagingOptions
```

<br />

*** ** * ** ***

Build-time properties for packaging dex files inside an APK `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/Component`.

This is accessed via `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ApkPackaging#dex()`

## Summary

| ### Public properties |
|---|---|
| `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html>` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/DexPackagingOptions#useLegacyPackaging()` Whether to use the legacy convention of compressing all dex files in the APK. |

## Public properties

### useLegacyPackaging

Added in 4.2.0

```
val useLegacyPackaging: Property<Boolean>
```

Whether to use the legacy convention of compressing all dex files in the APK.

This property is initialized from the `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/DexPackaging#useLegacyPackaging()` DSL element, if set. If this property and the DSL are unset, dex files will be uncompressed when minSdk \>= 28. If this property is set, the value will be fed directly to the corresponding Gradle tasks without extra logic.

This property does not affect dex file compression in APKs produced from app bundles.