Commit 6d7e6ec
committed
fix(android): restore namespace fallback for libraries not applying the React plugin
#57038 narrowed configureNamespaceForLibraries from a rootProject-wide sweep to
only the project applying `com.facebook.react`. That was necessary because the old
code re-ran the sweep from every library, and AGP 9 errors when `finalizeDsl` is
registered after a project's DSL has been finalized.
The narrowing has a side effect: third-party Android libraries that do NOT apply
`com.facebook.react` and still rely on the manifest `package` attribute (e.g. older
react-native-linear-gradient) no longer receive a namespace, so they fail under
AGP 9 with "Namespace not specified".
Restore the broad coverage by sweeping all `com.android.library` subprojects once,
from the application project (which applies the plugin a single time, avoiding the
repeated-traversal finalizeDsl error from #57038). Guard configureNamespaceForLibraries
so it registers its finalizeDsl callback at most once per project, since libraries
that DO apply the React plugin are now reachable from both the per-library hook and
the app-level sweep.1 parent ad2cf4d commit 6d7e6ec
2 files changed
Lines changed: 25 additions & 0 deletions
File tree
- packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react
- utils
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
116 | 130 | | |
117 | 131 | | |
118 | 132 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
109 | 118 | | |
110 | 119 | | |
111 | 120 | | |
| |||
122 | 131 | | |
123 | 132 | | |
124 | 133 | | |
| 134 | + | |
| 135 | + | |
125 | 136 | | |
126 | 137 | | |
127 | 138 | | |
| |||
0 commit comments