diff --git a/react.gradle b/react.gradle index 74fd2306adb3f5..af5f2aef87e790 100644 --- a/react.gradle +++ b/react.gradle @@ -97,6 +97,9 @@ afterEvaluate { packageTask = variant.packageLibrary } + // pre bundle build task for Android plugin 3.2+ + def buildPreBundleTask = tasks.findByName("build${targetName}PreBundle") + def resourcesDirConfigValue = config."resourcesDir${targetName}" if (resourcesDirConfigValue) { def currentCopyResTask = tasks.create( @@ -114,6 +117,9 @@ afterEvaluate { } packageTask.dependsOn(currentCopyResTask) + if (buildPreBundleTask != null) { + buildPreBundleTask.dependsOn(currentCopyResTask) + } } def currentAssetsCopyTask = tasks.create( @@ -144,5 +150,8 @@ afterEvaluate { } packageTask.dependsOn(currentAssetsCopyTask) + if (buildPreBundleTask != null) { + buildPreBundleTask.dependsOn(currentAssetsCopyTask) + } } }