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)
}
just u need to add this import in same file : import com.facebook.flipper.android.utils.FlipperUtils;