diff --git a/react.gradle b/react.gradle index 014d30d69a78e5..0edc7ca3bc5a4f 100644 --- a/react.gradle +++ b/react.gradle @@ -282,20 +282,26 @@ afterEvaluate { if (config."jsBundleDir${targetName}") { from(jsBundleDir) into(file(config."jsBundleDir${targetName}")) - } else { + } else { into ("$buildDir/intermediates") - into ("assets/${targetPath}") { - from(jsBundleDir) - } + if (isAndroidLibrary) { + into ("library_assets/${variant.name}/out") { + from(jsBundleDir) + } + } else { + into ("assets/${targetPath}") { + from(jsBundleDir) + } - // Workaround for Android Gradle Plugin 3.2+ new asset directory - into ("merged_assets/${variant.name}/merge${targetName}Assets/out") { - from(jsBundleDir) - } + // Workaround for Android Gradle Plugin 3.2+ new asset directory + into ("merged_assets/${variant.name}/merge${targetName}Assets/out") { + from(jsBundleDir) + } - // Workaround for Android Gradle Plugin 3.4+ new asset directory - into ("merged_assets/${variant.name}/out") { - from(jsBundleDir) + // Workaround for Android Gradle Plugin 3.4+ new asset directory + into ("merged_assets/${variant.name}/out") { + from(jsBundleDir) + } } } @@ -303,6 +309,7 @@ afterEvaluate { dependsOn(variant.mergeAssetsProvider.get()) enabled(currentBundleTask.enabled) + dependsOn(currentBundleTask) } // mergeResources task runs before the bundle file is copied to the intermediate asset directory from Android plugin 4.1+.