Flipper doesn't show my network plugin and shows connection problem

1.9k Views Asked by At

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)
}
2

There are 2 best solutions below

0
On

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

0
On

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