diff --git a/react.gradle b/react.gradle index 64b2f02f8cbf26..16692f53883c85 100644 --- a/react.gradle +++ b/react.gradle @@ -70,6 +70,23 @@ gradle.projectsEvaluated { resourcesDir.mkdirs() } + // Fix android build release error: "Duplicate file, Original is here" + doLast { + def moveFunc = { resSuffix -> + File originalDir = file("${resourcesDir}/drawable-${resSuffix}") + if (originalDir.exists()) { + File destDir = file("${resourcesDir}/drawable-${resSuffix}-v4") + ant.move(file: originalDir, tofile: destDir) + } + } + moveFunc.curry("ldpi").call() + moveFunc.curry("mdpi").call() + moveFunc.curry("hdpi").call() + moveFunc.curry("xhdpi").call() + moveFunc.curry("xxhdpi").call() + moveFunc.curry("xxxhdpi").call() + } + // Set up inputs and outputs so gradle can cache the result inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) outputs.dir jsBundleDir