06/04/2021 - react-native setup on windows and vscode

tutorial
https://www.youtube.com/watch?v=Hf4MJH0jDb4

docs
https://reactnative.dev/docs/environment-setup


error
JAVA_HOME is not set and no 'java' command could be found in your PATH.
cause
user variable were set via the control panel but the system variable not in sync, had to set as admin in command prompt


solution
https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html

dependencies for windows
  • java sdk (same version as the jre within the android sdk folder), android has the jre but lacks the jdk
  • android studio (android runs on java)
  • paths and windows environment variable must be set
and then you can use the react-native cli on vscode

  1. command prompt terminal choco install -y nodejs.install openjdk8
  2. browser search and install android studio
  3. android studio app > config>sdk manager> sdk> check for android 10 q else add
  4. control panel pane set ANDROID_HOME, the url is inside the sdk manager
  5. command prompt terminal set JAVA_HOME, it should be under c:/programme files/java
  6. control panel pane set the PATH for android home > platform tools and java home>bin (where the java file is)
  7. vscode terminal npm i -g react native cli
  8. vscode terminal npx react-native init [name]
  9. vscode terminal react-native run-android





Comments

Popular posts from this blog

green tea bitch

song

20231104