Flipper 不显示我的网络插件并显示连接问题

发布于 2025-01-14 20:30:03 字数 1322 浏览 4 评论 0原文

我的同事也做了同样的事情,他的脚蹼工作正常,但我的脚蹼不显示网络插件和请求。即使在同一设备中启动其他应用程序,它也能很好地工作。我进行了调试并收到错误:在此处输入图像描述

有人知道我该如何解决这个问题吗?

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:enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

最冷一天 2025-01-21 20:30:03

我通过重新安装 Flipper 并在 gradle 中更新其库解决了问题。

i solved problem by reinstalling flipper and updating its libraries in gradle.

恬淡成诗 2025-01-21 20:30:03

只需您需要在同一个文件中添加此导入:
导入 com.facebook.flipper.android.utils.FlipperUtils;

just u need to add this import in same file :
import com.facebook.flipper.android.utils.FlipperUtils;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文