Skip to content

Commit 5fe631f

Browse files
committed
fix: scope React Gradle codegen to this library
Without an explicit `react { libraryName, codegenJavaPackageName, jsRootDir }` block, the React Gradle Plugin (applied by `apply plugin: 'com.facebook.react'` under `isNewArchitectureEnabled`) scans every codegen-spec package found in the app's node_modules and bundles all of them into this AAR. When the app also installs the real owner (e.g. react-native-screens), D8 hits duplicate `*ViewManagerDelegate` types and `mergeLibDexDebug` fails. Pin `libraryName = 'NitroQdrantEdge'` so codegen emits classes only for our own (nonexistent) view managers — keeping the AAR free of foreign codegen output.
1 parent ad55ca2 commit 5fe631f

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

android/build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,16 @@ dependencies {
161161
implementation project(":react-native-nitro-modules")
162162
}
163163

164+
// Without this `react { }` block, the React Gradle Plugin scans every npm
165+
// package in the app and emits view-manager codegen for all of them into our
166+
// AAR, then the same classes appear again from each real owner (e.g.
167+
// react-native-screens) and D8 fails with duplicate-type errors. Pinning
168+
// `libraryName` keeps codegen scoped to this lib alone.
169+
if (isNewArchitectureEnabled()) {
170+
react {
171+
jsRootDir = file("../src/")
172+
libraryName = "NitroQdrantEdge"
173+
codegenJavaPackageName = "com.margelo.nitro.qdrantedge"
174+
}
175+
}
176+

0 commit comments

Comments
 (0)