From e083f9a139b3f8c5552528f8f8018529ef3193b9 Mon Sep 17 00:00:00 2001 From: Jagdeep Nagpal Date: Wed, 28 Sep 2016 04:21:53 -0700 Subject: [PATCH] Fix missing static images when using data binding Summary: **Motivation** Images not getting bundled when data binding is enabled in gradle in Android projects. So to fix it running the bundle task before ```dataBindingProcessLayouts``` gradle task **Test plan** Example project with data binding enabled https://github.com/jaggs6/rn_data_binding (master) note in ```app/build.gradle``` ``` dataBinding { enabled = true } ``` when the app is running in debug you will see the following ![screenshot_1474456348](https://cloud.githubusercontent.com/assets/1941517/18708823/b11e306c-7ff4-11e6-89c9-5b74f0f5d1c6.png) and when installing and running a release variant (```./gradlew uninstallAll clean installRelease```) you will see this ![screenshot_1474456603](https://cloud.githubusercontent.com/assets/1941517/18708926/4658991a-7ff5-11e6-9a29-78333504b20f.png) (note the missing image) to fix this problem I added the fix in react.gradle file and moved it into the project (branch master_working) here is the compare https://github.com/jaggs6/rn_d Closes https://github.com/facebook/react-native/pull/10017 Differential Revision: D3936552 Pulled By: bestander fbshipit-source-id: 9ed9181eb331668de15745b1e06fcf6f79cebb0f --- react.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/react.gradle b/react.gradle index 2cc825c211..09c06ca7e5 100644 --- a/react.gradle +++ b/react.gradle @@ -98,6 +98,7 @@ gradle.projectsEvaluated { runBefore("process${flavorNameCapitalized}X86${buildNameCapitalized}Resources", currentBundleTask) runBefore("processUniversal${targetName}Resources", currentBundleTask) runBefore("process${targetName}Resources", currentBundleTask) + runBefore("dataBindingProcessLayouts${targetName}", currentBundleTask) } } }