Skip to content

Commit bf600af

Browse files
committed
Fix auto-linking from Gradle
1 parent c5f1d21 commit bf600af

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.changeset/quick-boats-beam.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-native-node-api": patch
3+
---
4+
5+
Fixed auto-linking from Gradle / Android

packages/host/android/build.gradle

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,14 @@ def commandLinePrefix = OperatingSystem.current().isWindows() ? ["cmd", "/c", "n
162162
def cliPath = file("../bin/react-native-node-api.mjs")
163163

164164
// Custom task to fetch jniLibs paths via CLI
165-
task linkNodeApiModules {
165+
task linkNodeApiModules(type: Exec) {
166+
commandLine commandLinePrefix + [cliPath, 'link', '--android', rootProject.rootDir.absolutePath]
167+
standardOutput = System.out
168+
errorOutput = System.err
169+
// Enable color output
170+
environment "FORCE_COLOR", "1"
171+
166172
doLast {
167-
exec {
168-
commandLine commandLinePrefix + [cliPath, 'link', '--android', rootProject.rootDir.absolutePath]
169-
standardOutput = System.out
170-
errorOutput = System.err
171-
// Enable color output
172-
environment "FORCE_COLOR", "1"
173-
}
174-
175173
android.sourceSets.main.jniLibs.srcDirs += file("../auto-linked/android").listFiles()
176174
}
177175
}

0 commit comments

Comments
 (0)