Skip to content

Android: res/values of dependencies overwrite each other in the AAR #490

Closed

Description

@gronxb

When more than one dependency ships res/values resources, the brownfield AAR keeps only one of them. Every exploded AAR stores its values in res/values/values.xml, and CopyExplodedResTask copies each dependency's res directory into one output with copyRecursively(out, overwrite = true) (ResourceTaskProcessor.kt), so each values.xml replaces the previous one.

The attributes, styles, and colors of the overwritten dependencies are missing from the AAR, while files in other folders that reference them (for example values-v31) are kept. The consumer app then fails at resource linking:

error: resource attr/bootSplashBackground (aka com.example:attr/bootSplashBackground) not found.

Repro: a React Native project with react-native-bootsplash 7.1.0 and @callstack/react-native-brownfield (which ships its own res/values/values.xml). After brownfield package:android, the AAR's res/values/values.xml contains only React Native Brownfield's style, and the consumer app's processReleaseResources fails as above.

Workaround: remove the dependency, or declare its missing resources in the consumer app.

Possibly related: #125, which reported duplicate resources during AAR packaging.

Tested with: @callstack/react-native-brownfield 5.3.0, brownfield-gradle-plugin 2.0.0-alpha10, React Native 0.85.2. The code above is unchanged on main.

Activity

  1. gronxb commented on Oct 14, 2026

    @gronxb
    ContributorAuthor

    Closing this one as it's no longer blocking me. Feel free to reopen if it's worth tracking.

  2. added 4 commits that reference this issue on Oct 22, 2026
    13271a0
    65e1082
    700905b
    ae9691e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions