Failed to intall the app in react native, how can I fix this?

Viewed 36
2 Answers

Looks like the terminal output gives you several steps to do/check.

  1. Make sure you have properly set up your android environment. Use this link to do so. You can use Expo-Cli or React-Native-Cli.

  2. SDK location not found. This could be an off-shoot error of not properly doing step 1. However, to cover all of your bases, ensure you have properly set up your Android Emulator. This doc is a great walkthrough.

Once your Android studio and AVD Manager is properly set up, and your development environment is properly set, you should have no issues!

Please let me know if doing the above to steps did or did not solve your errors.

If you follow the steps, https://reactnative.dev/docs/environment-setup and https://developer.android.com/studio/run/emulator there will be no problem.

As a React Native fan on Windows 10, I'd like to mention just few points you need to check.

  • First, please check following user variables in Environment Variables ( You can see it from System Properties). adb="C:\Users{username}\AppData\Local\Android\Sdk\platform-tools" ANDROID_HOME="C:\Users{username}\AppData\Local\Android\Sdk"

    JAVA_HOME="C:\Program Files\OpenJDK\openjdk-11.0.15_10"

    Path: check if contains {ANDROID_HOME}\platform-tools Eg:"C:\Users{username}\AppData\Local\Android\Sdk\platform-tools"

enter image description here

  • Second, if you are using Android Sdk emulator, please make sure that it configured correctly in emulator list in Android Studio. For an instance, I created a android emulator using android sdk-29 and you can check the followings.

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

  • Third, I recommend you, deploy first app on emulator in Android Studio. Because we need to download gradle zip file and others, it's essential to run your first android app in Android Studio. When you confirmed your first android app(Deploy empty project app is also okay), you can run your React Native App by Expo-cli or react-native-cli.
Related