diff --git a/node_modules/react-native/react.gradle b/node_modules/react-native/react.gradle index 4ead2b6..7c3b11c 100644 --- a/node_modules/react-native/react.gradle +++ b/node_modules/react-native/react.gradle @@ -48,6 +48,24 @@ afterEvaluate { resourcesDir.mkdirs() } + // From https://stackoverflow.com/questions/53239705/react-native-error-duplicate-resources-android + // Currently has no solution? + doLast { + def moveFunc = { resSuffix -> + File originalDir = file("$buildDir/generated/res/react/release/drawable-${resSuffix}"); + if (originalDir.exists()) { + File destDir = file("$buildDir/../src/main/res/drawable-${resSuffix}"); + 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)