Android Studio 2.3 Instant Run Not Working & Won't Fix in 2.3

305 views Asked by At

When using:

  • Using Android Studio 2.3.x
  • Debug (not Run)

Apply changes / Instant Run always restarts app.

Apply Changes Button

What am I doing wrong?

1

There are 1 answers

0
Baker On

Known Issue - Won't Fix in Android Studio 2.3

While running in Debug mode, Instant Run / Apply Changes will never hot swap changes from your code due to a service that needs to be running on your device / emulator being killed by Android's activity manager

https://issuetracker.google.com/issues/37135977#comment11

Ok, the root cause of the issue is that when you have instant run enabled, in 2.3, we do the following two steps:

  1. Launch a server (running as part of a service).
  2. Launch your activity.

When the activity is launched with the debugger enabled, then android's activity manager seems to kill the service. That causes all future communication between the IDE and the service to fail, and you only get coldswaps.

In 2.3, we'll have this limitation that only applies to debug sessions. In 2.4, hotswap changes during debugging should work as expected.

We can't promise a specific timeline for 2.4, but we are trying to release the first preview as soon as we can!