Yesterday my app was running perfect from Android Studio
but today when I started working on my app and running it i am getting error message continuously
Easily can be solved this problem.
Ex:- in Huawei GR3 mobile,
Goto Setting in your mobile -> Storage -> Storage Cleaner
This is caused by "instant run" feature, you can disable it by:
Open the Settings or Preferences dialog. Navigate to Build, Execution, Deployment > Instant Run.
Uncheck the box next to Enable Instant Run and u are ready to go.
In my case Instant Run hided the real cause of the problem which was INSUFFICIENT_SPACE due to small data partition and I also got "failed to establish session" error. After disabling Instant Run, the real problem was revealed and after fixing it and enabling Instant Run it worked.
Here's my solution (there's no need to deactivate instant run) Do all these steps in the stated order:
1- Gradle Build (root level)
gradle
2 - Gradle build + clean (app level)
gradle app
3 - Choose app on the top bar (left of Run 'app')
4 - Clean Project:
Navigate to Build > Clean Project
And it should work now! You shouldn't disable instant run if you follow these steps
If you use MIUI ROM
Go to the developer option and in that disable MIUI optimization.You will be asked to reboot your phone. Reboot it and then run the app.
Again in this issue also I found Instant Run buggy. When I disable the Instant run and run the app again App starts successfully installing in the Device without showing any error Window. I hope google will sort out these Issues with Instant run soon.
Steps to disable Instant Run from Android Studio:
File > Settings > Build,Execution,Deployment > Instant Run > Un-check (Enable Instant Run to hot swap code)