diff --git a/react.gradle b/react.gradle index bcc24b0c24cd18..34d99aa0cacdf1 100644 --- a/react.gradle +++ b/react.gradle @@ -97,6 +97,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( @@ -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) + } } }