diff --git a/react.gradle b/react.gradle index 3f41b1bc5a278f..c817da81c722ac 100644 --- a/react.gradle +++ b/react.gradle @@ -92,6 +92,9 @@ afterEvaluate { ? variant.packageApplication : tasks.findByName("package${targetName}") + // 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( @@ -109,6 +112,9 @@ afterEvaluate { } packageTask.dependsOn(currentCopyResTask) + if (buildPreBundleTask != null) { + buildPreBundleTask.dependsOn(currentCopyResTask) + } } def currentAssetsCopyTask = tasks.create( @@ -139,5 +145,8 @@ afterEvaluate { } packageTask.dependsOn(currentAssetsCopyTask) + if (buildPreBundleTask != null) { + buildPreBundleTask.dependsOn(currentAssetsCopyTask) + } } }