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

We Are Going To Discuss About ‘Source code does not match the bytecode’ when debugging on a device. So lets Start this Java Article.

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

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

    Here is my solution:
    If you got more than one library version, this may help.
    set a breakpoint on the lib source code
    let the code run to the breakpoint
    you will got these tips

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

    Here is my solution:
    If you got more than one library version, this may help.
    set a breakpoint on the lib source code
    let the code run to the breakpoint
    you will got these tips

Solution 1

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

Original Author Michael Hoffmann Of This Content

Solution 2

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

Original Author Jeffery Ma Of This Content

Solution 3

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.

Original Author Uriel Frankel Of This Content

Solution 4

If you use Gradle, it is probably a problem with Gradle caches. (Reference). Alas, even if you run

gradle --refresh-dependencies

, it is not refreshing really all dependencies. Some rubbish remains. (Reference).

So, the most sure (but drastic and long) variant is to clear all inside from the [user]/.gradle/caches. Or to find your problem project there and clear only its caches.

Original Author Gangnus Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment