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

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


There's an open issue for this in Google's IssueTracker.

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

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


Here is my solution:

If you got more than one library version, this may help.

  1. set a breakpoint on the lib source code
  2. let the code run to the breakpoint
  3. you will got these tips

enter image description here

  1. click the arrow icon

  2. you will get this

    enter image description here

  3. double click to select the correct lib (normally the highest version of the lib is correct)

I have clicked the "disable" button by mistake, you can enable it in the debugger setting

enter image description here

If you do not have the tips in the step 3, maybe you can check whether you have checked the setting options


You should use an Android emulator with the same api level as the compileSdkVersion.In your case you should use Android emulator with api level 21.