Add workaround for Android Gradle Plugin 3.2 change to asset dir (#21409)
Summary: Android Gradle Plugin 3.2 uses a new intermediates/merged_assets directory instead of intermediates/assets. This workaround copies the javascript bundle to both directories for compatibility purposes. Fixes #21132 Fixes #18357 Pull Request resolved: https://github.com/facebook/react-native/pull/21409 Differential Revision: D10141860 Pulled By: hramos fbshipit-source-id: 0fb20fcec67ec2bfd7a8d9052599bbc70464b466
This commit is contained in:
parent
8a4975051e
commit
ff084a4e80
17
react.gradle
17
react.gradle
|
@ -122,9 +122,20 @@ afterEvaluate {
|
|||
group = "react"
|
||||
description = "copy bundled JS into ${targetName}."
|
||||
|
||||
from jsBundleDir
|
||||
into file(config."jsBundleDir${targetName}" ?:
|
||||
"$buildDir/intermediates/assets/${targetPath}")
|
||||
if (config."jsBundleDir${targetName}") {
|
||||
from jsBundleDir
|
||||
into file(config."jsBundleDir${targetName}")
|
||||
} else {
|
||||
into ("$buildDir/intermediates")
|
||||
into ("assets/${targetPath}") {
|
||||
from jsBundleDir
|
||||
}
|
||||
|
||||
// Workaround for Android Gradle Plugin 3.2+ new asset directory
|
||||
into ("merged_assets/${targetPath}/merge${targetName}Assets/out") {
|
||||
from jsBundleDir
|
||||
}
|
||||
}
|
||||
|
||||
// mergeAssets must run first, as it clears the intermediates directory
|
||||
dependsOn(variant.mergeAssets)
|
||||
|
|
Loading…
Reference in New Issue