# FailureRetention

# FailureRetention

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

<br />

```
@Incubating
interface FailureRetention : EmulatorSnapshots
```

<br />

*** ** * ** ***

| **This interface is deprecated.**   
| Renamed to EmulatorSnapshots

Options for configuring Android Test Retention.

When enabled, Android Test Retention automatically takes emulator snapshots on test failures.

## Summary

|                               ### Public properties                                |
|------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [enable](https://developer.android.com/reference/tools/gradle-api/8.9/com/android/build/api/dsl/FailureRetention#enable()) **This property is deprecated.**Renamed to enableForTestFailures                   |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [maxSnapshots](https://developer.android.com/reference/tools/gradle-api/8.9/com/android/build/api/dsl/FailureRetention#maxSnapshots()) **This property is deprecated.**Renamed to maxSnapshotsForTestFailures |

|                                                                                                                                                                                                                                                                                                                                                                                                                    ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                    |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[com.android.build.api.dsl.EmulatorSnapshots](https://developer.android.com/reference/tools/gradle-api/8.9/com/android/build/api/dsl/EmulatorSnapshots) |------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [retainAll](https://developer.android.com/reference/tools/gradle-api/8.9/com/android/build/api/dsl/EmulatorSnapshots#retainAll())`()` Call this function to take unlimited number of test failure snapshots (will ignore maxSnapshotsForTestFailures setting) | |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ### Inherited properties                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[com.android.build.api.dsl.EmulatorSnapshots](https://developer.android.com/reference/tools/gradle-api/8.9/com/android/build/api/dsl/EmulatorSnapshots) |------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [compressSnapshots](https://developer.android.com/reference/tools/gradle-api/8.9/com/android/build/api/dsl/EmulatorSnapshots#compressSnapshots()) Enables snapshot compression.                                             | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [enableForTestFailures](https://developer.android.com/reference/tools/gradle-api/8.9/com/android/build/api/dsl/EmulatorSnapshots#enableForTestFailures()) Enables automated test failure snapshots.                         | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [maxSnapshotsForTestFailures](https://developer.android.com/reference/tools/gradle-api/8.9/com/android/build/api/dsl/EmulatorSnapshots#maxSnapshotsForTestFailures()) Maximum number of failures that would be snapshotted. | |

## Public properties

### enable

Added in 4.2.0  
Deprecated in 7.0.0  

```
var enable: Boolean
```
| **This property is deprecated.**   
Renamed to enableForTestFailures  

### maxSnapshots

Added in 4.2.0  
Deprecated in 7.0.0  

```
var maxSnapshots: Int
```
| **This property is deprecated.**   
| Renamed to maxSnapshotsForTestFailures