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

眉间皱痕 提交于 2020-01-02 03:35:33

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/36556093/android-studio-2-0-update-public-static-volatile-com-android-tools-fd-runtime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!