Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 2.0 update - public static volatile com.android.tools.fd.runtime.IncrementalChange

After I update with Android 2.0 a new field has been added into my models object public static volatile com.android.tools.fd.runtime.IncrementalChange com.pr4.models.User.$change

What problem I have faced : i.e I was reading the field using reflection package and creating a dynamic table using fields, and my app get crashed due to new field $change, If i put a check to skip particular modifier field then I have to make lot of changes. Why a new field was added at runtime in my code, how to get rid of it?

like image 281
turbandroid Avatar asked Apr 11 '16 18:04

turbandroid


1 Answers

It happens due to Instant Run a new feature introduced in 2.0 Android studio and it can be disabled as follows.

http://tools.android.com/tech-docs/instant-run

By default, Android Studio automatically restarts the current activity after performing a hot swap, while the app keeps running. To disable this setting:

Open the Settings or Preferences dialog.

Navigate to Build, Execution, Deployment > Instant Run.

Uncheck the box next to Restart activity on code changes. If automatic activity restart is disabled, you can manually restart the current activity from the menu bar by selecting Run > Restart Activity.

like image 85
aks.knit1108 Avatar answered Oct 08 '22 21:10

aks.knit1108