Skip to content

Duplicate assets issue #226

Description

@realdadfish

In

the plugin determines all configured assets directories of a specific build variant to be able to copy the generated resources to it.

IMHO this is the wrong approach, because this leads to a "duplicate assets" issue as shown below:

> Task :app:mergeDebugAssets FAILED
ERROR:/path/to/app/src/main/assets/open_source_licenses.html /path/to/app/build/generated/other-generated-assets/open_source_licenses.html: Resource and asset merger: Duplicate resources

It doesn't make much sense to just take "the first" or only the first not in /build either, because you cannot foresee what the module owner had in mind when (s)he configured his module with multiple asset directories. A better approach would be

  1. Add your own build directory to the assets source set, so it can be merged with the rest of the assets, or
  2. Allow users to configure a specific asset directory where generated assets should be copied to

Obviously, these two options should be mutual exclusive, otherwise people will stumble upon the same error above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions