More descriptive error message when Gradle build/install fails

Summary: Inspired by: https://twitter.com/geirmanc/status/660275638637477889

There are many reasons why the Gradle build could fail and the best
thing to do is to read the error message.

We can provide some hints in the most common cases though.

public

Reviewed By: vjeux

Differential Revision: D2604747

fb-gh-sync-id: 1aa83abb9ec823c03814dcc31d630a8f1914cf5c
This commit is contained in:
Martin Konicek 2015-11-03 03:46:08 -08:00 committed by facebook-github-bot-4
parent fcb0367bf3
commit 4411ad49a4
1 changed files with 4 additions and 1 deletions

View File

@ -79,7 +79,10 @@ function buildAndRun(args, reject) {
});
} catch (e) {
console.log(chalk.red(
'Could not install the app on the device, see the error above.'
'Could not install the app on the device, read the error above for details.\n' +
'Make sure you have an Android emulator running or a device connected and have\n' +
'set up your Android development environment:\n' +
'https://facebook.github.io/react-native/docs/android-setup.html'
));
// stderr is automatically piped from the gradle process, so the user
// should see the error already, there is no need to do