Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# FailureRetention\n================\n\n\n```\n@Incubating interface FailureRetention : EmulatorSnapshots\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n| **This interface is deprecated.** \n| Renamed to EmulatorSnapshots\n\nOptions for configuring Android Test Retention.\n\nWhen enabled, Android Test Retention automatically takes emulator snapshots on test failures.\n\nSummary\n-------\n\n| ### Public properties ||\n|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [enable](/reference/tools/gradle-api/7.4/com/android/build/api/dsl/FailureRetention#enable()) **This property is deprecated.** Renamed to enableForTestFailures |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [maxSnapshots](/reference/tools/gradle-api/7.4/com/android/build/api/dsl/FailureRetention#maxSnapshots()) **This property is deprecated.** Renamed to maxSnapshotsForTestFailures |\n\n| ### Inherited functions ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| From class [com.android.build.api.dsl.EmulatorSnapshots](/reference/tools/gradle-api/7.4/com/android/build/api/dsl/EmulatorSnapshots) |------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [retainAll](/reference/tools/gradle-api/7.4/com/android/build/api/dsl/EmulatorSnapshots#retainAll())`()` Call this function to take unlimited number of test failure snapshots (will ignore maxSnapshotsForTestFailures setting) | |\n\n| ### Inherited properties ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| From class [com.android.build.api.dsl.EmulatorSnapshots](/reference/tools/gradle-api/7.4/com/android/build/api/dsl/EmulatorSnapshots) |------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [compressSnapshots](/reference/tools/gradle-api/7.4/com/android/build/api/dsl/EmulatorSnapshots#compressSnapshots()) Enables snapshot compression. | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [enableForTestFailures](/reference/tools/gradle-api/7.4/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](/reference/tools/gradle-api/7.4/com/android/build/api/dsl/EmulatorSnapshots#maxSnapshotsForTestFailures()) Maximum number of failures that would be snapshotted. | |\n\nPublic properties\n-----------------\n\n### enable\n\n```\nvar enable: Boolean\n```\n| **This property is deprecated.** \nRenamed to enableForTestFailures \n\n### maxSnapshots\n\n```\nvar maxSnapshots: Int\n```\n| **This property is deprecated.** \n| Renamed to maxSnapshotsForTestFailures"]]