Fixing React Native Error Failed to install the app

Fixing React Native Error Failed to install the app

Fixing react native unable to launch android emulator error


Baraa Abuzaid
Baraa Abuzaid
@baraaabuzaid
Fixing React Native Error Failed to install...

One of the things that you may dislike about react native is this kind of mysterious errors that popup from time to time. Where anything works in harmony and suddenly you encounter

error Failed to install the app. Make sure you have the Android development environment set up

And I can swear to you that my Android development environment was all set correctly because seconds ago everything was perfect!
So only if you can swear like me that your android development were setup, then feel free to continue with this solution.
Otherwise, you may checkout setting up the development environment Article on https://reactnative.dev/docs/environment-setup

#So what you can do is to

  • Remove node_modules
  • Install node_modules again at project root
npm install
  • Move to android folder
cd android
  • Run the following commands to give gradlew file permissions
chmod +x ./gradlew
xattr -l ./gradlew
  • Skip this step if you already have Homebrew install in your Mac
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Now come the most important step. Which is installing ADB platform-tools
brew cask install android-platform-tools
  • Close your terminal then reopen it again and run following command at your project root.
npx react-native run-android

Show Comments (0)

Comments

Related Articles

React Suspense And Fetching Approach
General

React Suspense And Fetching Approach

When it comes to fetching and rendering content in a React App, there are a few key strategies to consider: Fetch on render, Fetch then render, fetch as you render. Of these, the...

Posted on by Baraa Abuzaid
The basic of stream in Dart
Dart

The basic of stream in Dart

If you’ve been toying around with Dart and Flutter you would’ve noticed how streams are very much well integrated into the systems. streams are a very powerful concept...

Posted on by Baraa Abuzaid