Giter Site home page Giter Site logo

dingprog / networkcaptureself Goto Github PK

View Code? Open in Web Editor NEW
314.0 8.0 48.0 726 KB

基于OKHttp的实用抓包小工具,你值得拥有

Home Page: https://juejin.im/post/5ddddd2a6fb9a07161483fb2

License: Apache License 2.0

Java 100.00%
android okhttp networkcapture network captrue tools

networkcaptureself's Introduction

概览

一个基于OKHttp的实用抓包小工具

工具界面截图

支持功能

  • 自带分类接口
  • 抓包数据以时间为纬度,默认存储到手机缓存下 /Android/Data/包名/Cache/capture/ 下
  • 支持Http/Https协议的抓包,分类请求方式/请求URL/请求Header/请求体/响应状态/响应Header/响应体
  • 支持一键复制对应的状态
  • 响应体如果是JSON,支持自动格式化
  • 抓包数据,默认缓存一天

快速接入

allprojects {
	repositories {
	   maven { url 'https://jitpack.io' }
	}
}

dependencies {
    debugImplementation 'com.github.DingProg.NetworkCaptureSelf:library:v1.0.1'
    releaseImplementation 'com.github.DingProg.NetworkCaptureSelf:library_no_op:v1.0.1'
}

在你的全局OkHttp中添加 Interceptor

new OkHttpClient.Builder()
        .addInterceptor(new CaptureInfoInterceptor())
        .build();

注意事项

注意接入时 debugImplementation 和 releaseImplementation区别,releaseImplementation中不包含任何其他代码

如果您的项目中还有buildType 是develop,那么developImplementation 请依赖 'com.github.DingProg.NetworkCaptureSelf:library:v1.0.1'

More

关于更多,请查看 Blog

networkcaptureself's People

Contributors

dingprog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

networkcaptureself's Issues

某些机型出现闪退情况

复现机型:vivo x7
系统版本:5.1.1
报错时机:
进入app时首次调用网络请求就闪退,导致app无法使用(首屏都进不去)。
通过对照测试发现只要使用CaptureInfoInterceptor就会复现此问题。
报错堆栈:
image
4-28 14:57:34.447 32379-32419 E/CrashReport: # LAUNCH TIME: 2020-04-28 14:57:33 04-28 14:57:34.447 32379-32419 E/CrashReport: # CRASH TYPE: JAVA_CATCH 04-28 14:57:34.447 32379-32419 E/CrashReport: # CRASH TIME: 2020-04-28 14:57:34 04-28 14:57:34.447 32379-32419 E/CrashReport: # CRASH PROCESS: com.zl.lezhu 04-28 14:57:34.447 32379-32419 E/CrashReport: # CRASH THREAD: RxCachedThreadScheduler-2 04-28 14:57:34.447 32379-32419 E/CrashReport: # REPORT ID: 21d445b4-187b-4dc5-a259-f38c03e8f3ad 04-28 14:57:34.447 32379-32419 E/CrashReport: # CRASH DEVICE: vivo X7 UNROOT 04-28 14:57:34.447 32379-32419 E/CrashReport: # RUNTIME AVAIL RAM:1246134272 ROM:30381637632 SD:29752492032 04-28 14:57:34.447 32379-32419 E/CrashReport: # RUNTIME TOTAL RAM:3752390656 ROM:57441845248 SD:56812699648 04-28 14:57:34.447 32379-32419 E/CrashReport: # CRASH STACK: 04-28 14:57:34.447 32379-32419 E/CrashReport: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | com.ding.library.internal.utils.CacheUtils at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.NoSuchMethodError: com.ding.library.internal.utils.CacheUtils at com.ding.library.CaptureInfoInterceptor.intercept(CaptureInfoInterceptor.java:159) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:212) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at com.lezhu.common.http.InterceptorUtil$2.intercept(InterceptorUtil.java:109) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at ren.yale.android.retrofitcachelibrx2.intercept.MockInterceptor.intercept(MockInterceptor.java:29) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254) at okhttp3.RealCall.execute(RealCall.java:92) at retrofit2.OkHttpCall.execute(OkHttpCall.java:186) at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:45) at io.reactivex.Observable.subscribe(Observable.java:12090) at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:34) at io.reactivex.Observable.subscribe(Observable.java:12090) at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96) at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)  at java.util.concurrent.FutureTask.run(FutureTask.java:237)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)  at java.lang.Thread.run(Thread.java:818)  04-28 14:57:34.447 32379-32419 E/CrashReport: #++++++++++++++++++++++++++++++++++++++++++# 04-28 14:57:34.447 32379-32417 E/CrashReport: #++++++++++Record By Bugly++++++++++# 04-28 14:57:34.447 32379-32417 E/CrashReport: # You can use Bugly(http:\\bugly.qq.com) to get more Crash Detail! 04-28 14:57:34.447 32379-32417 E/CrashReport: # PKG NAME: com.zl.lezhu 04-28 14:57:34.447 32379-32417 E/CrashReport: # APP VER: 6.3.0_beta(2020042814) 04-28 14:57:34.447 32379-32417 E/CrashReport: # LAUNCH TIME: 2020-04-28 14:57:33 04-28 14:57:34.447 32379-32417 E/CrashReport: # CRASH TYPE: JAVA_CATCH 04-28 14:57:34.447 32379-32417 E/CrashReport: # CRASH TIME: 2020-04-28 14:57:34 04-28 14:57:34.447 32379-32417 E/CrashReport: # CRASH PROCESS: com.zl.lezhu 04-28 14:57:34.447 32379-32417 E/CrashReport: # CRASH THREAD: RxCachedThreadScheduler-1 04-28 14:57:34.447 32379-32417 E/CrashReport: # REPORT ID: 73900366-6907-451e-822c-77b874b56232 04-28 14:57:34.447 32379-32417 E/CrashReport: # CRASH DEVICE: vivo X7 UNROOT 04-28 14:57:34.447 32379-32417 E/CrashReport: # RUNTIME AVAIL RAM:1246642176 ROM:30381645824 SD:29752500224 04-28 14:57:34.447 32379-32417 E/CrashReport: # RUNTIME TOTAL RAM:3752390656 ROM:57441845248 SD:56812699648 04-28 14:57:34.447 32379-32417 E/CrashReport: # CRASH STACK: 04-28 14:57:34.447 32379-32417 E/CrashReport: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | com.ding.library.internal.utils.CacheUtils at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.NoSuchMethodError: com.ding.library.internal.utils.CacheUtils at com.ding.library.CaptureInfoInterceptor.intercept(CaptureInfoInterceptor.java:159) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:212) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at com.lezhu.common.http.InterceptorUtil$2.intercept(InterceptorUtil.java:109) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at ren.yale.android.retrofitcachelibrx2.intercept.MockInterceptor.intercept(MockInterceptor.java:29) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254) at okhttp3.RealCall.execute(RealCall.java:92) at retrofit2.OkHttpCall.execute(OkHttpCall.java:186) at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:45) at io.reactivex.Observable.subscribe(Observable.java:12090) at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:34) at io.reactivex.Observable.subscribe(Observable.java:12090) at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96) at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)  at java.util.concurrent.FutureTask.run(FutureTask.java:237)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)  at java.lang.Thread.run(Thread.java:818)  04-28 14:57:34.447 32379-32417 E/CrashReport: #++++++++++++++++++++++++++++++++++++++++++# 04-28 14:57:34.447 32379-32502 E/setErrorHandler:: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | com.ding.library.internal.utils.CacheUtils 04-28 14:57:34.447 32379-32418 E/CrashReport: Java Catch Happen 04-28 14:57:34.447 32379-32418 E/CrashReport: stack frame :9, has cause true 04-28 14:57:34.457 32379-32503 E/setErrorHandler:: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | com.ding.library.internal.utils.CacheUtils 04-28 14:57:34.457 32379-32418 E/CrashReport: #++++++++++Record By Bugly++++++++++# 04-28 14:57:34.457 32379-32418 E/CrashReport: # You can use Bugly(http:\\bugly.qq.com) to get more Crash Detail! 04-28 14:57:34.457 32379-32418 E/CrashReport: # PKG NAME: com.zl.lezhu 04-28 14:57:34.457 32379-32418 E/CrashReport: # APP VER: 6.3.0_beta(2020042814) 04-28 14:57:34.457 32379-32418 E/CrashReport: # LAUNCH TIME: 2020-04-28 14:57:33 04-28 14:57:34.457 32379-32418 E/CrashReport: # CRASH TYPE: JAVA_CATCH 04-28 14:57:34.457 32379-32418 E/CrashReport: # CRASH TIME: 2020-04-28 14:57:34 04-28 14:57:34.457 32379-32418 E/CrashReport: # CRASH PROCESS: com.zl.lezhu 04-28 14:57:34.457 32379-32418 E/CrashReport: # CRASH THREAD: RxCachedThreadScheduler-3 04-28 14:57:34.457 32379-32418 E/CrashReport: # REPORT ID: e28c0be4-95f7-450a-b7ae-2b67f20e4888 04-28 14:57:34.457 32379-32418 E/CrashReport: # CRASH DEVICE: vivo X7 UNROOT 04-28 14:57:34.457 32379-32418 E/CrashReport: # RUNTIME AVAIL RAM:1244311552 ROM:30381629440 SD:29752483840 04-28 14:57:34.457 32379-32418 E/CrashReport: # RUNTIME TOTAL RAM:3752390656 ROM:57441845248 SD:56812699648 04-28 14:57:34.457 32379-32418 E/CrashReport: # CRASH STACK: 04-28 14:57:34.457 32379-32418 E/CrashReport: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | com.ding.library.internal.utils.CacheUtils at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.NoSuchMethodError: com.ding.library.internal.utils.CacheUtils at com.ding.library.CaptureInfoInterceptor.intercept(CaptureInfoInterceptor.java:159) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:212) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at com.lezhu.common.http.InterceptorUtil$2.intercept(InterceptorUtil.java:109) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at ren.yale.android.retrofitcachelibrx2.intercept.MockInterceptor.intercept(MockInterceptor.java:29) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254) at okhttp3.RealCall.execute(RealCall.java:92) at retrofit2.OkHttpCall.execute(OkHttpCall.java:186) at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:45) at io.reactivex.Observable.subscribe(Observable.java:12090) at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:34) at io.reactivex.Observable.subscribe(Observable.java:12090) at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96) at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)  at java.util.concurrent.FutureTask.run(FutureTask.java:237)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)  at java.lang.Thread.run(Thread.java:818)  04-28 14:57:34.457 32379-32418 E/CrashReport: #++++++++++++++++++++++++++++++++++++++++++# 04-28 14:57:34.487 32379-32417 E/CrashReport: Java Catch Happen 04-28 14:57:34.497 32379-32417 E/CrashReport: stack frame :9, has cause true 04-28 14:57:34.507 32379-32417 E/CrashReport: #++++++++++Record By Bugly++++++++++# 04-28 14:57:34.507 32379-32417 E/CrashReport: # You can use Bugly(http:\\bugly.qq.com) to get more Crash Detail! 04-28 14:57:34.507 32379-32417 E/CrashReport: # PKG NAME: com.zl.lezhu 04-28 14:57:34.507 32379-32417 E/CrashReport: # APP VER: 6.3.0_beta(2020042814) 04-28 14:57:34.507 32379-32417 E/CrashReport: # LAUNCH TIME: 2020-04-28 14:57:33 04-28 14:57:34.507 32379-32417 E/CrashReport: # CRASH TYPE: JAVA_CATCH 04-28 14:57:34.507 32379-32417 E/CrashReport: # CRASH TIME: 2020-04-28 14:57:34 04-28 14:57:34.507 32379-32417 E/CrashReport: # CRASH PROCESS: com.zl.lezhu 04-28 14:57:34.507 32379-32417 E/CrashReport: # CRASH THREAD: RxCachedThreadScheduler-4 04-28 14:57:34.507 32379-32417 E/CrashReport: # REPORT ID: c958ed91-6c4d-427f-9f6c-90d964501b67 04-28 14:57:34.507 32379-32417 E/CrashReport: # CRASH DEVICE: vivo X7 UNROOT 04-28 14:57:34.507 32379-32417 E/CrashReport: # RUNTIME AVAIL RAM:1235259392 ROM:30381404160 SD:29752258560 04-28 14:57:34.507 32379-32417 E/CrashReport: # RUNTIME TOTAL RAM:3752390656 ROM:57441845248 SD:56812699648 04-28 14:57:34.507 32379-32417 E/CrashReport: # CRASH STACK: 04-28 14:57:34.507 32379-32417 E/CrashReport: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | com.ding.library.internal.utils.CacheUtils at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.NoSuchMethodError: com.ding.library.internal.utils.CacheUtils at com.ding.library.CaptureInfoInterceptor.intercept(CaptureInfoInterceptor.java:159) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:212) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at com.lezhu.common.http.InterceptorUtil$2.intercept(InterceptorUtil.java:109) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at ren.yale.android.retrofitcachelibrx2.intercept.MockInterceptor.intercept(MockInterceptor.java:29) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254) at okhttp3.RealCall.execute(RealCall.java:92) at retrofit2.OkHttpCall.execute(OkHttpCall.java:186) at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:45) at io.reactivex.Observable.subscribe(Observable.java:12090) at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:34) at io.reactivex.Observable.subscribe(Observable.java:12090) at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96) at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)  at java.util.concurrent.FutureTask.run(FutureTask.java:237)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)  at java.lang.Thread.run(Thread.java:818)  04-28 14:57:34.507 32379-32417 E/CrashReport: #++++++++++++++++++++++++++++++++++++++++++# 04-28 14:57:34.577 32379-32492 E/CrashReport: sys default last handle start! 04-28 14:57:34.577 32379-32492 E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher Process: com.zl.lezhu, PID: 32379 java.lang.NoSuchMethodError: No virtual method checkSelfPermission(Ljava/lang/String;)I in class Landroid/content/Context; or its super classes (declaration of 'android.content.Context' appears in /system/framework/framework.jar) at com.ding.library.internal.utils.CacheUtils.<init>(CacheUtils.java:40) at com.ding.library.internal.utils.CacheUtils.<clinit>(CacheUtils.java:28) at com.ding.library.CaptureInfoInterceptor.intercept(CaptureInfoInterceptor.java:159) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:212) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at com.lezhu.common.http.InterceptorUtil$2.intercept(InterceptorUtil.java:109) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at ren.yale.android.retrofitcachelibrx2.intercept.MockInterceptor.intercept(MockInterceptor.java:29) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:200) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818)

关于 library 依赖库建议

implementation 'androidx.appcompat:appcompat:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:29.0.0'
implementation 'com.zaihuishou:expandablerecycleradapter:1.0.3'
implementation 'com.android.support:support-v4:29.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.7.0'
implementation 'com.alibaba:fastjson:1.2.34'

建议修改成 :

compileOnly 'com.squareup.okhttp3:okhttp:3.7.0'
compileOnly 'androidx.recyclerview:recyclerview:1.1.0'

Activity 用 android 包不需要导库,至于 JSON 写个接口把所需功能抛出来用户自己选择转换,不需要依赖太多库(库版本偏低、冲突等),直接 Recyclerview 列表展示点击查看详情

尽量减少依赖太多库,越简单越好。

有一个包没有内容

releaseImplementation 'com.github.DingProg.NetworkCaptureSelf:library_no_op:v1.0.1'

这个是非必须依赖吧,里面都没有任何东西被使用

关于debug与release建议

目前咱们的库是debug包就显示入口,release包不显示,能否考虑这个显示规则自己在application里面配置,因为一般发给QA测试也得发release包测试混淆

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.