How to debug “com.android.okhttp”

前端 未结 1 469
野趣味
野趣味 2021-02-19 03:26

In android kitkat, URLConnection\'s implementation has been replaced by OkHttp,How can it debug it?

The OkHttp is in this directory:external/okhttp/android/main/j

1条回答
  •  佛祖请我去吃肉
    2021-02-19 04:15

    It seems from version 0.8.x onwards of Android Studio the option to attach specific sources at the Android SDK has been removed (Read comments here https://plus.google.com/+CyrilMottier/posts/GNcGL6xVth1).

    I guess if you want to debug you could try an older version or Android Studio, or (and I'd go with this solution) export a portion of your application to Eclipse (the Android SDK version), maybe just the part involving the troublesome connection, and there you can attach sources for a class that has no sources attached during debug very easily, you should see a page with just the signatures of the methods in the Source Code View, with the button to "Attach source"

    http://4.bp.blogspot.com/-a2EnbC4wP6g/UN2Z7QzFlyI/AAAAAAAAAg0/D2tFh6AgRrM/s1600/Eclipse_String_Class_File.PNG

    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题