Skip to content

Android: local jars of dependencies (libs/*.jar) are not packaged into the AAR #489

Closed

Description

@gronxb

The Gradle plugin does not package the local jars of a dependency (libs/*.jar inside its exploded AAR) into the brownfield AAR. A library that ships a jar in android/libs builds and runs fine in a regular app, but the consumer of the brownfield AAR crashes at runtime with NoClassDefFoundError for the jar's classes.

AndroidArchiveLibrary.getLocalJars() returns those jars, but nothing calls it: AndroidArchiveLibrary.kt defines it, and MergeClassesTask only merges each dependency's classes.jar (MergeClassesTask.kt).

Repro: add a dependency whose android/build.gradle has implementation files("libs/some.jar"), package with brownfield package:android, and use a class from the jar in the consumer app. The class is missing from the AAR.

Workaround: ship the jar's sources in the library instead of the jar.

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, since I worked around it by compiling the library's sources instead of shipping the jar. Feel free to reopen if it's worth tracking.

  2. added 3 commits that reference this issue on Oct 22, 2026
    0e6b990
    9c5d7be
    3195472
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