When building for Android with React Native, Java must be installed in the environment.
The major one is Java distributed by Oracle. But Android Studio ships with the Open JDK instead.
Use Java included in Android Studio to build React Native because it will be less troublesome to combine with Android Studio and you will not have to worry about changing the license of Oracle Java [^ 1]. ..
[^ 1]: License changed for "Oracle Java" -Free use is for personal development, testing, and demo purposes only .html)
Describe as follows in .bash_profile
.
export PATH=$PATH:/Applications/"Android Studio.app"/Contents/jre/jdk/Contents/Home/bin
export JAVA_HOME=/Applications/"Android Studio.app"/Contents/jre/jdk/Contents/Home
Use the JDK used in Android Studio in the terminal https://qiita.com/tsumuchan/items/43a55789f1cf213611cc
Recommended Posts