StethoInterceptor 在匕首刀柄后不起作用

问题描述

我们单独使用StethoInterceptor,但在hilt重构后似乎不起作用 设备存在于chrome://inspec 但网络选项卡为空

 @Singleton
        @Provides
        fun provideRetrofit(okHttpClient: OkHttpClient): Retrofit = Retrofit.Builder()
                .baseUrl(RetrofitClientInstance.baseUrl)
                .client(okHttpClient)
                .addConverterFactory(GsonConverterFactory.create())
                .build()
    
        @Singleton
        @Provides
        fun provideOkHttpClient(): OkHttpClient =
                        OkHttpClient.Builder()
                        .protocols(listof(Protocol.HTTP_1_1,Protocol.HTTP_2))
                        .addInterceptor(loggingInterceptor())
                        .connectTimeout(2,TimeUnit.MINUTES)
                        .writeTimeout(2,TimeUnit.MINUTES) // write timeout
                        .readTimeout(2,TimeUnit.MINUTES) // read timeout
                        .addInterceptor(TokenExpireInterceptor())
                        .addInterceptor(TokenAuthenticatorInterceptor())
                        .addInterceptor(RequestLoggingInterceptor())
                        .addNetworkInterceptor(StethoInterceptor())
                        .retryOnConnectionFailure(true)
                        .build()

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)