Stay organized with collections
Save and categorize content based on your preferences.
AndroidResources
interface AndroidResources
Known direct subclasses
AaptOptions |
This interface is deprecated. Renamed to AndroidResources
|
DSL object for configuring aapt options.
Summary
Public functions |
@Incubating Unit |
Adds additional parameters to be passed to aapt .
|
@Incubating Unit |
Adds additional parameters to be passed to aapt .
|
@Incubating Unit |
Adds a file extension of Android resources, assets, and Java resources to be stored uncompressed in the APK.
|
@Incubating Unit |
Adds file extensions of Android resources, assets, and Java resources to be stored uncompressed in the APK.
|
Public properties |
MutableList<String> |
List of additional parameters to pass to aapt .
|
Boolean |
Forces aapt to return an error if it fails to find an entry for a configuration.
|
String? |
Pattern describing assets to be ignored.
|
MutableCollection<String> |
Patterns describing assets to be ignored.
|
Boolean |
Indicates whether the resources in this sub-project are fully namespaced.
|
MutableCollection<String> |
File extensions of Android resources, assets, and Java resources to be stored uncompressed in the APK.
|
Public functions
noCompress
@Incubating
fun noCompress(noCompress: String): Unit
Adds a file extension of Android resources, assets, and Java resources to be stored uncompressed in the APK. Adding an empty extension (i.e., noCompress('')
) will disable compression for all Android resources, assets, and Java resources.
noCompress
@Incubating
fun noCompress(vararg noCompress: String): Unit
Adds file extensions of Android resources, assets, and Java resources to be stored uncompressed in the APK. Adding an empty extension (e.g., noCompress('')
) will disable compression for all Android resources, assets, and Java resources.
Public properties
failOnMissingConfigEntry
var failOnMissingConfigEntry: Boolean
Forces aapt to return an error if it fails to find an entry for a configuration.
See aapt --help
ignoreAssetsPatterns
val ignoreAssetsPatterns: MutableCollection<String>
Patterns describing assets to be ignored.
If empty, defaults to ["!.svn", "!.git", "!.ds_store", "!*.scc", ".*", "<dir>_*", "!CVS", "!thumbs.db", "!picasa.ini", "!*~"]
namespaced
var namespaced: Boolean
Indicates whether the resources in this sub-project are fully namespaced.
This property is incubating and may change in a future release.
noCompress
val noCompress: MutableCollection<String>
File extensions of Android resources, assets, and Java resources to be stored uncompressed in the APK. Adding an empty extension (e.g., setting noCompress ''
) will disable compression for all Android resources, assets, and Java resources.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# AndroidResources\n================\n\n\n```\ninterface AndroidResources\n```\n\n\u003cbr /\u003e\n\nKnown direct subclasses \n[AaptOptions](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/AaptOptions) \n\n|--------------------------------------------------------------------------------------|---------------------------------------------------------------|\n| [AaptOptions](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/AaptOptions) | **This interface is deprecated.** Renamed to AndroidResources |\n\n*** ** * ** ***\n\nDSL object for configuring aapt options.\n\nSummary\n-------\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html)` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [additionalParameters](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/AndroidResources#additionalParameters(kotlin.String))`(params: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds additional parameters to be passed to `aapt`. |\n| `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html)` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [additionalParameters](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/AndroidResources#additionalParameters(kotlin.Array))`(vararg params: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds additional parameters to be passed to `aapt`. |\n| `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html)` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [noCompress](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/AndroidResources#noCompress(kotlin.String))`(noCompress: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds a file extension of Android resources, assets, and Java resources to be stored uncompressed in the APK. |\n| `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html)` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [noCompress](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/AndroidResources#noCompress(kotlin.Array))`(vararg noCompress: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds file extensions of Android resources, assets, and Java resources to be stored uncompressed in the APK. |\n\n| ### Public properties ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)`\u003c`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`\u003e` | [additionalParameters](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/AndroidResources#additionalParameters()) List of additional parameters to pass to `aapt`. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [failOnMissingConfigEntry](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/AndroidResources#failOnMissingConfigEntry()) Forces aapt to return an error if it fails to find an entry for a configuration. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` | [ignoreAssetsPattern](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/AndroidResources#ignoreAssetsPattern()) Pattern describing assets to be ignored. |\n| [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)`\u003c`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`\u003e` | [ignoreAssetsPatterns](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/AndroidResources#ignoreAssetsPatterns()) Patterns describing assets to be ignored. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [namespaced](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/AndroidResources#namespaced()) Indicates whether the resources in this sub-project are fully namespaced. |\n| [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)`\u003c`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`\u003e` | [noCompress](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/AndroidResources#noCompress()) File extensions of Android resources, assets, and Java resources to be stored uncompressed in the APK. |\n\nPublic functions\n----------------\n\n### additionalParameters\n\n```\n@Incubating\nfun additionalParameters(params: String): Unit\n```\n\nAdds additional parameters to be passed to `aapt`. \n\n### additionalParameters\n\n```\n@Incubating\nfun additionalParameters(vararg params: String): Unit\n```\n\nAdds additional parameters to be passed to `aapt`. \n\n### noCompress\n\n```\n@Incubating\nfun noCompress(noCompress: String): Unit\n```\n\nAdds a file extension of Android resources, assets, and Java resources to be stored uncompressed in the APK. Adding an empty extension (i.e., `noCompress('')`) will disable compression for all Android resources, assets, and Java resources. \n\n### noCompress\n\n```\n@Incubating\nfun noCompress(vararg noCompress: String): Unit\n```\n\nAdds file extensions of Android resources, assets, and Java resources to be stored uncompressed in the APK. Adding an empty extension (e.g., `noCompress('')`) will disable compression for all Android resources, assets, and Java resources.\n\nPublic properties\n-----------------\n\n### additionalParameters\n\n```\nval additionalParameters: MutableList\u003cString\u003e\n```\n\nList of additional parameters to pass to `aapt`. \n\n### failOnMissingConfigEntry\n\n```\nvar failOnMissingConfigEntry: Boolean\n```\n\nForces aapt to return an error if it fails to find an entry for a configuration.\n\nSee `aapt --help` \n\n### ignoreAssetsPattern\n\n```\nvar ignoreAssetsPattern: String?\n```\n\nPattern describing assets to be ignored.\n\nThis is [ignoreAssetsPatterns](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/AndroidResources#ignoreAssetsPatterns()) joined by ':'. \n\n### ignoreAssetsPatterns\n\n```\nval ignoreAssetsPatterns: MutableCollection\u003cString\u003e\n```\n\nPatterns describing assets to be ignored.\n\nIf empty, defaults to `[\"!.svn\", \"!.git\", \"!.ds_store\", \"!*.scc\", \".*\", \"\u003cdir\u003e_*\", \"!CVS\", \"!thumbs.db\", \"!picasa.ini\", \"!*~\"]` \n\n### namespaced\n\n```\nvar namespaced: Boolean\n```\n\nIndicates whether the resources in this sub-project are fully namespaced.\n\nThis property is incubating and may change in a future release. \n\n### noCompress\n\n```\nval noCompress: MutableCollection\u003cString\u003e\n```\n\nFile extensions of Android resources, assets, and Java resources to be stored uncompressed in the APK. Adding an empty extension (e.g., setting `noCompress ''`) will disable compression for all Android resources, assets, and Java resources."]]