原因是Instant Run的问题。
Windows & Linux:
File -> Settings -> Build, Execution, Deployment -> Instant Run.
Mac:
Android Studio -> Preferences -> Build, Execution, Deployment -> Instant Run.
把Enable Instant Run to hot swap code的勾去掉
本文介绍如何通过禁用Android Studio中的InstantRun功能来解决代码热更新时出现的问题。针对不同操作系统,提供了详细的步骤指导。
File -> Settings -> Build, Execution, Deployment -> Instant Run.
Android Studio -> Preferences -> Build, Execution, Deployment -> Instant Run.
把Enable Instant Run to hot swap code的勾去掉

被折叠的 条评论
为什么被折叠?