Crocodile Crocodile - 9 months ago 473
Android Question

'Source code does not match the bytecode' when debugging on a device

I have an app which I am compiling against API level 21:
enter image description here

and then debug it on a real device with API level 23:

enter image description here

The problem is when I try debugging through the Android OS's own classes, I get 'Source code does not match the bytecode'. Why is this happening? The test device the app is running on is API level 23, and the source file being debugged is level 23 as well.
*enter image description here*

I am really confused. Can anyone explain why I am seeing this message and how I can fix it?

Answer Source

There's an open issue for this in AOSP, where some users have given possible solutions:

The potential solutions given there (as of the date of this post) are:

  • Click Build->Clean
  • Disable Instant Run, in Settings->Build, Execution, Deployment