From 531084d3eecd27c6cfcae2d9709c23c0edd26598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Mon, 15 Jul 2019 20:16:48 +0200 Subject: [PATCH] fix: run jetifier as executable to avoid race conditions --- .../platform-android/src/commands/runAndroid/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/platform-android/src/commands/runAndroid/index.js b/packages/platform-android/src/commands/runAndroid/index.js index 3ab90f60c..07c7c641b 100644 --- a/packages/platform-android/src/commands/runAndroid/index.js +++ b/packages/platform-android/src/commands/runAndroid/index.js @@ -66,9 +66,12 @@ function runAndroid(argv: Array, config: ConfigT, args: FlagsT) { 'You can disable it using "--no-jetifier" flag.', )}`, ); - // Jetifier is a side-effectful module without a default export. Requiring - // it ad-hoc. - require('jetifier'); + + try { + execFileSync(require.resolve('jetifier/bin/jetify'), {stdio: 'inherit'}); + } catch (error) { + throw new CLIError('Failed to run jetifier.', error); + } } if (!args.packager) {