Flipper 不显示我的网络插件并显示连接问题
我的同事也做了同样的事情,他的脚蹼工作正常,但我的脚蹼不显示网络插件和请求。即使在同一设备中启动其他应用程序,它也能很好地工作。我进行了调试并收到错误:
有人知道我该如何解决这个问题吗?
object FlipperInitializer {
private val networkFlipperPlugin = NetworkFlipperPlugin()
fun createNetworkPluginInterceptor(): FlipperInterceptor =
FlipperInterceptorImpl(FlipperOkhttpInterceptor(networkFlipperPlugin))
fun init(context: Context) {
SoLoader.init(context, false);
if (FlipperUtils.shouldEnableFlipper(context)) {
val client = AndroidFlipperClient.getInstance(context)
client.addPlugin(InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()))
client.addPlugin(networkFlipperPlugin)
client.addPlugin(CrashReporterPlugin.getInstance())
client.start()
}
}
}
internal class FlipperInterceptorImpl(private val interceptor: FlipperOkhttpInterceptor) : FlipperInterceptor {
override fun intercept(chain: Interceptor.Chain): Response {
return interceptor.intercept(chain)
}
}
应用程序类别:
override fun onCreate() {
super.onCreate()
if (BuildConfig.DEBUG) {
FlipperInitializer.init(this)
}
My colleague did the same and his flipper works fine, but my flipper doesnt show network plugin and requests. Even if start other apps in same device it works great. I did debugging and got the error:
Does anybody know how i can fix the problem?
object FlipperInitializer {
private val networkFlipperPlugin = NetworkFlipperPlugin()
fun createNetworkPluginInterceptor(): FlipperInterceptor =
FlipperInterceptorImpl(FlipperOkhttpInterceptor(networkFlipperPlugin))
fun init(context: Context) {
SoLoader.init(context, false);
if (FlipperUtils.shouldEnableFlipper(context)) {
val client = AndroidFlipperClient.getInstance(context)
client.addPlugin(InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()))
client.addPlugin(networkFlipperPlugin)
client.addPlugin(CrashReporterPlugin.getInstance())
client.start()
}
}
}
internal class FlipperInterceptorImpl(private val interceptor: FlipperOkhttpInterceptor) : FlipperInterceptor {
override fun intercept(chain: Interceptor.Chain): Response {
return interceptor.intercept(chain)
}
}
App class:
override fun onCreate() {
super.onCreate()
if (BuildConfig.DEBUG) {
FlipperInitializer.init(this)
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通过重新安装 Flipper 并在 gradle 中更新其库解决了问题。
i solved problem by reinstalling flipper and updating its libraries in gradle.
只需您需要在同一个文件中添加此导入:
导入 com.facebook.flipper.android.utils.FlipperUtils;
just u need to add this import in same file :
import com.facebook.flipper.android.utils.FlipperUtils;