Stay organized with collections
Save and categorize content based on your preferences.
ResourcesPackaging
interface ResourcesPackaging
Summary
Public properties
excludes
val excludes: SetProperty<String>
The set of excluded patterns. Java resources matching any of these patterns do not get packaged in the APK.
Example usage: packagingOptions.resources.excludes.add("**
/*.exclude")
merges
val merges: SetProperty<String>
The set of patterns for which matching java resources are merged. For each java resource APK entry path matching one of these patterns, all java resources with that path are concatenated and packaged as a single entry in the APK.
Example usage: packagingOptions.resources.merges.add("**
/*.merge")
pickFirsts
val pickFirsts: SetProperty<String>
The set of patterns for which the first occurrence is packaged in the APK. For each java resource APK entry path matching one of these patterns, only the first java resource found with that path gets packaged in the APK.
Example usage: packagingOptions.resources.pickFirsts.add("**
/*.pickFirst")
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,["# ResourcesPackaging\n==================\n\n\n```\ninterface ResourcesPackaging\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nSummary\n-------\n\n| ### Public properties ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [SetProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/SetProperty.html)`\u003c`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`\u003e` | [excludes](/reference/tools/gradle-api/7.3/com/android/build/api/variant/ResourcesPackaging#excludes()) The set of excluded patterns. |\n| [SetProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/SetProperty.html)`\u003c`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`\u003e` | [merges](/reference/tools/gradle-api/7.3/com/android/build/api/variant/ResourcesPackaging#merges()) The set of patterns for which matching java resources are merged. |\n| [SetProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/SetProperty.html)`\u003c`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`\u003e` | [pickFirsts](/reference/tools/gradle-api/7.3/com/android/build/api/variant/ResourcesPackaging#pickFirsts()) The set of patterns for which the first occurrence is packaged in the APK. |\n\nPublic properties\n-----------------\n\n### excludes\n\n```\nval excludes: SetProperty\u003cString\u003e\n```\n\nThe set of excluded patterns. Java resources matching any of these patterns do not get packaged in the APK.\n\nExample usage: `packagingOptions.resources.excludes.add(\"**`/`*.exclude\")` \n\n### merges\n\n```\nval merges: SetProperty\u003cString\u003e\n```\n\nThe set of patterns for which matching java resources are merged. For each java resource APK entry path matching one of these patterns, all java resources with that path are concatenated and packaged as a single entry in the APK.\n\nExample usage: `packagingOptions.resources.merges.add(\"**`/`*.merge\")` \n\n### pickFirsts\n\n```\nval pickFirsts: SetProperty\u003cString\u003e\n```\n\nThe set of patterns for which the first occurrence is packaged in the APK. For each java resource APK entry path matching one of these patterns, only the first java resource found with that path gets packaged in the APK.\n\nExample usage: `packagingOptions.resources.pickFirsts.add(\"**`/`*.pickFirst\")`"]]