I have an app which I am compiling against API level 21:
and then debug it on a real device with API level 23:
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.
I am really confused. Can anyone explain why I am seeing this message and how I can fix it?
There's an open issue for this in AOSP, where some users have given possible solutions: https://code.google.com/p/android/issues/detail?id=225199&sort=-id&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars
The potential solutions given there (as of the date of this post) are:
Neither disabling Instant Run or any of the other solutions in this link has worked for me.
@mister270 Did you find another solution? I haven't ever encountered this problem again, so it's hard for me to debug it and expand my answer here.
I upped the minimum sdk and did a clean rebuild which made the problem "go away". However I'm not satisfied with this solution as I wanted an older min sdk.
None of the above solutions have worked for me. I did not even find the Instant run option. It is so irritating to debug using INteelij. I am having to clean install after every single code change.