facebook / flipper

A desktop debugging platform for mobile developers.
https://fbflipper.com/
MIT License
13.25k stars 950 forks source link

[Android] Mocked the response , but not getting reflected at device. #5639

Open sumit-jha-Pw opened 1 week ago

sumit-jha-Pw commented 1 week ago

🐛 Bug Report

Have used this peace of code :- `object FlipperDebugger {

val networkFlipper = NetworkFlipperPlugin()
fun initialize(context: Context) {
    SoLoader.init(context, false)
    val client = AndroidFlipperClient.getInstance(context)
    client.addPlugin(InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()))
    client.addPlugin(CrashReporterPlugin.getInstance())
    client.addPlugin(DatabasesFlipperPlugin(context))
    LeakCanary.config = LeakCanary.config.run {
        copy(eventListeners = eventListeners + FlipperLeakEventListener())
    }
    client.addPlugin(networkFlipper)
    client.addPlugin(LeakCanary2FlipperPlugin())
    client.start()
}

} and httpClient.addNetworkInterceptor(FlipperOkhttpInterceptor(FlipperDebugger.networkFlipper,true))` Attached image for mocked api

Screenshot 2024-06-20 at 1 20 47 PM

But when this API is hit again then no mocked response shown Using flipper-> 0.250.0 have added all dependency debugImplementation "com.facebook.flipper:flipper:$flipper" debugImplementation "com.facebook.soloader:soloader:$soLoader" debugImplementation "com.facebook.flipper:flipper-leakcanary2-plugin:$flipper" debugImplementation "com.facebook.flipper:flipper-network-plugin:$flipper"