Answered with working solution here:
https://stackoverflow.com/a/32236703/1267536
Full content:
I use appcompat support library quite a lot. Changing the compileSdkVersion only results in massive compile errors. If you are using appcompat-21, you must compile against api 21 or you will get compile errors.
This works fine if you are debugging against version 21. But when you are debugging on Jelly Bean (API 17), your debugger keeps dropping you to the API 21 source. Very annoying and hard to debug.
The solution I've ended up using is very hacky but works! Let's say you are trying to debug against API 17. Do the following:
- mv $ANDROID_HOME/sources/android-21 $ANDROID_HOME/sources/android-21-orig
- cp $ANDROID_HOME/sources/android-17 $ANDROID_HOME/sources/android-21
- restart android studio so it will pick up the correct paths.
- Debug
Just don't forget to put all the directories back after you're done.
Here's an android studio bug report about this issue:
https://code.google.com/p/android/issues/detail?id=183976
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…