File tree 1 file changed +9
-0
lines changed
packages/cli-platform-android/src/commands/runAndroid
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import chalk from 'chalk';
10
10
import execa from 'execa' ;
11
11
import { Config } from '@react-native-community/cli-types' ;
12
12
import {
13
+ link ,
13
14
logger ,
14
15
CLIError ,
15
16
printRunDoctorTip ,
@@ -137,6 +138,14 @@ function createInstallError(error: Error & {stderr: string}) {
137
138
message = `Please accept all necessary Android SDK licenses using Android SDK Manager: "${ chalk . bold (
138
139
'$ANDROID_HOME/tools/bin/sdkmanager --licenses' ,
139
140
) } ."`;
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.`;
140
149
}
141
150
142
151
return new CLIError (
You can’t perform that action at this time.
0 commit comments