1

When I hit the Run or Debug button, everything appears to be normal. The app starts, breakpoints break... However, sometimes the code does not reflect changes. The only way to remedy this is restarting AS. It would be fine if I just needed to restart AS a few times per day. Unfortunately, this happens as frequently as once every half an hour or so. The target device is an Android 5.1.

How do I know the code is not updated? I just add a statement as following to see if the Android Monitor shows it:

Log.d("debug", "********************** THIS IS A NEW LINE OF CODE *********************************");

Is there a better way than restarting AS to remedy this? Or even better, any way to prevent this?

Hong
  • 17,643
  • 21
  • 81
  • 142
  • I think instant run is enable. to have advantage from instant run your min api should be above 15 (for better performance should be above 21) – Amir May 04 '16 at 14:43
  • http://developer.android.com/tools/building/building-studio.html#instant-run – Amir May 04 '16 at 14:44
  • Yes, it is enabled. The device is Android 5.1.1 – Hong May 04 '16 at 14:54
  • Whats your min-sdk ? It's seems instant run is buggy now. to prevent this issue you can disable your instant run. – Amir May 04 '16 at 15:00
  • Also take look at my question may help you http://stackoverflow.com/questions/36623917/first-launch-take-long-time-in-android-studio-2-0-gradle-2-0 – Amir May 04 '16 at 15:02
  • The miin-sdk is 10. Again, I am testing this right now exclusively with and API 22 device. I will try disabling instant-run. – Hong May 04 '16 at 15:10
  • update min-sdk to 15 (or 21) and this issue will be fixed. – Amir May 04 '16 at 15:13
  • The app needs to support devices with lower API such as 10 – Hong May 04 '16 at 15:38
  • 1
    I had the same problem. I solved following this page: http://stackoverflow.com/questions/29312900/android-studio-not-deploying-changes-to-app – Stefano Cristoni Jan 14 '17 at 17:36

0 Answers0