Search code examples
javaandroidvolatileandroid-studio-2.0

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?


Solution

  • 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.