Android studio shows sources from API of compileSdkVersion when debugging on device with older API

前端 未结 5 1462
慢半拍i
慢半拍i 2020-12-13 12:46

I am debugging with Android Studio (A.S) 1.0.2 with compileSdkVersion 21 set up in build.gradle. When using an emulator with API 21 everything works fine. The problem occurs

5条回答
  •  渐次进展
    2020-12-13 13:31

    Try debugging your app on a real device, compiling with the device's SDK level. The line numbers in the call stacks will probably be "out of sync" for classes provided by the device.

    Android Studio can't reliably provide the correct sources for your running device. Even if it would take into account the SDK version of the device you are debugging on, the device's firmware could (and propably will) still be compiled from different source files and just be compatible to the API.

    I think that's why Android Studio just shows the compile SDK versions of the classes provided by the target device. It just shows the compiler's reference implementation.

提交回复
热议问题