Skip to content

Commit 2fdbf6a

Browse files
cortinicofacebook-github-bot
authored andcommitted
Make sure configureNdkBuild* tasks are depending on preBuild
Summary: Due to a bug with AGP, the configureNdkBuild* tasks are not depending on preBuild tasks. We need to manually fix this otherwise the build will fail the first time the NDK is invoked. More on this here: https://issuetracker.google.com/issues/207403732 Changelog: [Android] [Fixed] - Make sure configureNdkBuild* tasks are depending on preBuild in the Android template. Reviewed By: passy Differential Revision: D34578860 fbshipit-source-id: 5d4caa7d2b7a976b1c9caa6dce8e186c1486cafa
1 parent f743bed commit 2fdbf6a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

template/android/app/build.gradle

+14
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,20 @@ android {
186186
// preBuild.dependsOn("generateCodegenArtifactsFromSchema")
187187
preDebugBuild.dependsOn(packageReactNdkDebugLibs)
188188
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
189+
190+
// Due to a bug inside AGP, we have to explicitly set a dependency
191+
// between configureNdkBuild* tasks and the preBuild tasks.
192+
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
193+
configureNdkBuildRelease.dependsOn(preReleaseBuild)
194+
configureNdkBuildDebug.dependsOn(preDebugBuild)
195+
reactNativeArchitectures().each { architecture ->
196+
tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
197+
dependsOn("preDebugBuild")
198+
}
199+
tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
200+
dependsOn("preReleaseBuild")
201+
}
202+
}
189203
}
190204
}
191205

0 commit comments

Comments
 (0)