Start of with, I tried all the suggestions in SO and none helped me.
Suggestion1,Suggestion2,Suggestion3.
I'm doing some debugging (Just running the app on my device through Android Studio
) and I noticed that time after time, changes that I made in the app does not applied to the .apk
AS is running.
The only solution I know is to delete the app from my device and then running again and it compiles with the changes I made in the code. Alternatively, I restart Android Studio
and it fixes that too.
I try all suggestions on the site including: file -> invalidate Chaches / Restart -> invalidate, and changing my Run -> Edit Configuration settings but turned out unsuccesfully.I also read all the documentation here but It just repeats the answers here.
My Run -> Edit Configuration
So what's up with Android Studio
not applying my code changes?
EDIT:
So for now still no fix suggestion is working. Even my File -> Invalidate Caches / Restart -> Invalidate and Restart
not working either.
There is a bug with the new Instant Run feature, the app is not reloaded correctly.
You can disable Instant Run in File > Settings > Build, Execution, Deployment > Instant Run
and uncheck the first checkbox. Now when you click the Run
button, the app will be refreshed correctly.
How do you deploy the changes in your app to the device? I used to do it by pressing the green triangle (the "play" button) which is the first on the right from the name of the app in the top toolbar. In the new AS version, when you make changes to your app, that button gets a small thunderbolt icon next to the green triangle, like here:
This new icon means that AS will try to do an "Instant Run", ie. to make a hot swap or a warm swap to your app as it is running. Sadly, this hasn't been working as advertised for me (I have been using the new AS for a week now). Instead, I go for the "ReRun selected configuration" button, the fifth on the right, with the gray square and the curved arrow in order to send the changed .apk to the device.