Skip to content

Commit

Permalink
Make sure configureNdkBuild* tasks are depending on preBuild
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cortinico authored and facebook-github-bot committed Mar 2, 2022
1 parent f743bed commit 2fdbf6a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions template/android/app/build.gradle
Expand Up @@ -186,6 +186,20 @@ android {
// preBuild.dependsOn("generateCodegenArtifactsFromSchema")
preDebugBuild.dependsOn(packageReactNdkDebugLibs)
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)

// Due to a bug inside AGP, we have to explicitly set a dependency
// between configureNdkBuild* tasks and the preBuild tasks.
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
configureNdkBuildRelease.dependsOn(preReleaseBuild)
configureNdkBuildDebug.dependsOn(preDebugBuild)
reactNativeArchitectures().each { architecture ->
tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
dependsOn("preDebugBuild")
}
tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
dependsOn("preReleaseBuild")
}
}
}
}

Expand Down

0 comments on commit 2fdbf6a

Please sign in to comment.