Skip to content

Commit 4054b41

Browse files
Adding RN docs link for JDK install error (#1902)
* Adding RN docs link for JDK install error * Update packages/cli-platform-android/src/commands/runAndroid/runOnAllDevices.ts --------- Co-authored-by: Arushi Kesarwani <[email protected]> Co-authored-by: Michał Pierzchała <[email protected]>
1 parent 6d22b62 commit 4054b41

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/cli-platform-android/src/commands/runAndroid/runOnAllDevices.ts

+9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import chalk from 'chalk';
1010
import execa from 'execa';
1111
import {Config} from '@react-native-community/cli-types';
1212
import {
13+
link,
1314
logger,
1415
CLIError,
1516
printRunDoctorTip,
@@ -137,6 +138,14 @@ function createInstallError(error: Error & {stderr: string}) {
137138
message = `Please accept all necessary Android SDK licenses using Android SDK Manager: "${chalk.bold(
138139
'$ANDROID_HOME/tools/bin/sdkmanager --licenses',
139140
)}."`;
141+
} else if (stderr.includes('requires Java')) {
142+
message = `Looks like your Android environment is not properly set. Please go to ${chalk.dim.underline(
143+
link.docs('environment-setup', {
144+
hash: 'jdk-studio',
145+
guide: 'native',
146+
platform: 'android',
147+
}),
148+
)} and follow the React Native CLI QuickStart guide to install the compatible version of JDK.`;
140149
}
141150

142151
return new CLIError(

0 commit comments

Comments
 (0)