From a6c7049f39f87885cf4d3fc486ec8a8782cf5450 Mon Sep 17 00:00:00 2001 From: Tomoaki Imai Date: Wed, 14 Oct 2020 11:31:26 -0700 Subject: [PATCH] Fix apk/aab missing bundle file with gradle plugin with 4.1.0/gradle 6.5 Ensure mergeResources task runs after currentAssetsCopyTask --- react.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/react.gradle b/react.gradle index 5872681aa423fb..5995ad5fbb328a 100644 --- a/react.gradle +++ b/react.gradle @@ -302,6 +302,11 @@ afterEvaluate { enabled(currentBundleTask.enabled) } + // mergeResources task runs before the bundle file is copied to the intermediate asset directory from Android plugin 4.1+. + // This ensures to copy the bundle file before mergeResources task starts + def mergeResourcesTask = tasks.findByName("merge${targetName}Resources") + mergeResourcesTask.dependsOn(currentAssetsCopyTask) + packageTask.dependsOn(currentAssetsCopyTask) if (buildPreBundleTask != null) { buildPreBundleTask.dependsOn(currentAssetsCopyTask)