H
H
Heretic Man2020-02-17 17:16:53
macOS
Heretic Man, 2020-02-17 17:16:53

Android react-native-cli project not starting?

On ios, it starts normally.
I run the Android emulator manually
and throws an error:
5e4a9f3187d9f769678917.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Heretic Man, 2020-02-18
@heretic_man

- On the off site it says that you need to install sdk8, but this is an outdated version, you need to download sdk 13 from https://www.oracle.com/java/technologies/javase-do...
- In the user folder, you need to edit .bash_profile (open . bash_profile) and paste the following:

export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export ANDROID_SDK_ROOT=$ANDROID_HOME
export ANDROID_AVD_HOME=$HOME/.android/avd
alias emulator='$ANDROID_SDK_ROOT/tools/emulator'
export PATH=$PATH:/opt/gradle/gradle-6.2/bin

- In Android studio, you need to download the latest version of Android (10 Q)
For Windows, the same song, except that the environment variable needs to be set in Environment Variables, here is the instruction
If you do not install the latest version of jdk, even with the emulator running, nothing will work.
The lesson (at least for me) is to always check the lines you copy to install / download the latest version of packages

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question