Skip to content

Android: AAR packaging fails for dependencies that declare their namespace only in AndroidManifest.xml #491

Closed

Description

@gronxb

Packaging the AAR fails for a dependency that declares its package only in AndroidManifest.xml instead of a namespace in build.gradle:

> No namespace found in .../node_modules/react-native-launch-arguments/android/build.gradle

AndroidArchiveLibrary.getNameSpaceFromBuildGradle() reads the namespace from the dependency's build.gradle text with a regex and errors when it is absent (AndroidArchiveLibrary.kt). Such libraries build in a regular app, because the React Native Gradle plugin sets the namespace from the manifest's package attribute, so they only break brownfield packaging.

Repro: add react-native-launch-arguments 4.1.1 (latest) and run brownfield package:android.

Suggestion: fall back to the package attribute of the dependency's AndroidManifest.xml, or to the namespace the Android Gradle plugin resolved for that project.

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. hurali97 commented on Oct 14, 2026

    @hurali97
    Member

    Hey @gronxb - I see that you have raised a few other issues too. I wanted to check whether these issues happened prior to brownfield-gradle-plugin 2.0.0-alpha10 so maybe on 2.0.0-alpha09 or 2.0.0-alpha08?

    The reason I am asking is that 2.0.0-alpha10 and 2.0.0-alpha09 shipped major capabilities like AGP v9 support, transitive dependency resolution etc, while 2.0.0-alpha08 was a regular release with expo support.

  2. gronxb commented on Oct 14, 2026

    @gronxb
    ContributorAuthor

    Thanks for checking, @hurali97! I only hit these on 2.0.0-alpha10 and didn't try alpha08 or alpha09, so I can't tell whether they're regressions. I've worked around this one on my side (I swapped the library for a local module), so I'll close it. Happy to reopen if more detail would help.

  3. hurali97 commented on Oct 14, 2026

    @hurali97
    Member

    @gronxb - Thanks for the context. Great that you have a workaround but I see this can be an issue for other people. I will try reproducing it and the other issues you have raised.

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