Open In App

What react-native :app:installDebug FAILED ?

Last Updated : 21 Nov, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

In this article we are going to fix this error i.e. if you are a react native developer then it’s a big possibility that you might come across this error. Let’s understand a solution that works wonders for this error. 

When does this error occur?

This error occurs when we try to run our react-native project on an emulator. For example: with the help of the following command-

npx react-native run-android 

This command starts making the processes work but then it fails when tries to launch the emulator from the android studio. Hence it fails in installing the application.  

Follow the below steps to Fix this error:

Step 1: Launch Android studio and open your project.

Step 2: Go to files and check if Invalidate Caches/Restart… option is active. If it’s not active then click on  Invalidate Caches/Restart… option.

 

 Step 3: Click on Invalidate and Restart.

 

  • After this, Your project is going to restart again on android studio. 
  • Wait until all the Gradle processes are finished. 

Step 4: Clear the cache of your emulator. To clear the cache click on AVD Manager.

 

Step 5: Click on the down arrow button and click WIPE Data. 

 

That’s all on the android studio side. For most of the users, the problem may not occur after these steps but if the problem is still not resolved then follow the below steps. 

  • Sometimes the metro bundler causes this problem while we try to run the application on the emulator. 
  • To resolve that we can start the metro bundler separately. 
  • As you would already know that npx react-native run-android does the entire task of running your application. But in this case, we are going to run the metro-bundler separately. 

Step 6: Write this command in your project directory:

npx react-native start --port 8084 --reset-cache

What does this command do? Well, it is going to reset the cache of the metro bundler and launches the metro bundler at the same time.

 

Now, We will be running the emulator separately. Open a new cmd(command Prompt) window and write the following command in your project directory.

npx react-native run-android 

Note: Close your all previous emulators if they are currently opened. 

 

Now you can see the build is successful this time. 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads