11

I am developing an Android app using Android Studio. The problem is that after I changed my code and run the studio, some time the changed version is not reflecting in my device.

Here is what I've tried and solved my problem...

1. Build > Clean Project > Run
2. Build > Rebuild Project > Run
3. Restart device

Do i all time tried this procedure for reflecting the latest code change? It is very boring... I have read the following:

Android Studio is installing old apk on device

Community
  • 1
  • 1
Rezaul Karim
  • 1,311
  • 1
  • 18
  • 26
  • Which AS version are you using? Have you tried disabling Instant Run? Preferences -> Build, Execution, Deployment -> Instant Run. – Ziem Feb 23 '16 at 12:18
  • Report that problem to them –  Feb 23 '16 at 12:31
  • android studio version is 1.5.1 and Instant Run is not visible in Preferences -> Build, Execution, Deployment section – Rezaul Karim Feb 23 '16 at 12:32

4 Answers4

4

There is an option called "Instant Run" in android studio that decreases the time of build process. If you use it, it may cause the problem. Try to turn it off.

I'm using Android Studio 2.0 Beta 5 and gradle 2.10 and I recommend using this version or above.

SalmanShariati
  • 3,873
  • 4
  • 27
  • 46
1

Turning off "Instant Run" will not be good idea if your app is huge.

Try following:

  1. "File -> Invalidate Caches / Restart ...".
  2. If you are using gradle 6.0 (it has a bug) use another version of gradle.
  3. Go to "Run > Edit Configuration" and under "Before launch:" add "Gradle-aware Make" as shown.

enter image description here

sifr_dot_in
  • 3,153
  • 2
  • 33
  • 42
0

I was facing the same Issue. Changed my code in Android Studio and start debugging to verify my implementation. Breakpoints were not hit and nothing of my changes were applied. For me, adding

task clean(type: Delete) {
    delete rootProject.buildDir
}

to build.gradle helped.

Mark Kowalski
  • 264
  • 2
  • 9
-1

First...Clean the project and then rebuild it. If this doesn't works then try to clean cache of Android studio in file menu.