After upgrading Flipper above version 0.69 in my React Native (0.64rc3) application, it keeps randomly crashing every few seconds. I believe it's related to an upgrade to FlipperRSocket.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[fir_7E90EF78-5ABF-438B-AA61-E00EBCD3CAD8_GULNetworkURLSession _flex_swizzle_5d2934b3_URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]: unrecognized selector sent to instance 0x600000d2c2a0'
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 732.18.6 - Device: iPhone 11 (73AD7B14-C154-4FE6-BF53-5F552D7E83FC) - Runtime: iOS 14.4 (18D46) - DeviceType: iPhone 11
0 CoreFoundation 0x00007fff20421af6 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007fff20177e78 objc_exception_throw + 48
2 CoreFoundation 0x00007fff204306f7 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
3 CoreFoundation 0x00007fff20426036 ___forwarding___ + 1489
4 CoreFoundation 0x00007fff20428068 _CF_forwarding_prep_0 + 120
5 Paired 0x000000010965b6ef __71+[FLEXNetworkObserver injectDownloadTaskDidWriteDataIntoDelegateClass:]_block_invoke.383 + 79
6 Paired 0x000000010964f36c +[FLEXNetworkObserver sniffWithoutDuplicationForObject:selector:sniffingBlock:originalImplementationBlock:] + 444
7 Paired 0x000000010965b4b6 __71+[FLEXNetworkObserver injectDownloadTaskDidWriteDataIntoDelegateClass:]_block_invoke_2 + 710
8 CFNetwork 0x00007fff236cffd5 _CFNetworkHTTPConnectionCacheSetLimit + 160777
9 libdispatch.dylib 0x00007fff2010532f _dispatch_call_block_and_release + 12
10 libdispatch.dylib 0x00007fff20106508 _dispatch_client_callout + 8
11 libdispatch.dylib 0x00007fff20112ff7 _dispatch_main_queue_callback_4CF + 1045
12 CoreFoundation 0x00007fff2038fdbb __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
13 CoreFoundation 0x00007fff2038a63e __CFRunLoopRun + 2685
14 CoreFoundation 0x00007fff203896d6 CFRunLoopRunSpecific + 567
15 GraphicsServices 0x00007fff2c257db3 GSEventRunModal + 139
16 UIKitCore 0x00007fff24696cf7 -[UIApplication _run] + 912
17 UIKitCore 0x00007fff2469bba8 UIApplicationMain + 101
18 Paired 0x0000000108f680f0 main + 112
19 libdyld.dylib 0x00007fff2025a3e9 start + 1
20 ??? 0x0000000000000001 0x0 + 1
iOS simulator, I've tried with iPhone 11 14 and iPhone 7 13.5, both crash.
Date/Time: 2021-02-17 15:45:46.991 +0000
OS Version: macOS 11.2.1 (20D74)
Report Version: 12
Bridge OS Version: 5.2 (18P4346)
For now the only workaround I've found is to revert back to 0.69.
Let me know if I can provide any additional information.
Which Flipper version you used ? Did you use 0.75.1 ?
Which Flipper version you used ? Did you use 0.75.1 ?
I've used 0.75.1 but it also manifests with 0.74, I haven't tried with others.
I am having the same problem too.
@diego-paired, do you hit a network request as well ? I am trying to repro the problem. I tried hitting a request too, but was not able to repro it.
I tried reproducing on our example, and it didn't cause a crash.

Can you provide an example to repro it ?
These were the only changes after 0.69 to the network swizzling part. In your project can you try out reverting these changes and see if things work or not.
Otherwise provide me with a repro project.
@diego-paired
My guess is that I will have to add back
else {
class_addMethod(cls, selector, implementation, methodDescription.types);
}
But need a repro first to verify this.
I think the cause of the problem may be that we enable hermes in IOS.
@meftunca
How can I test it ?
Can you try adding back the following at FLEXUtility.mm , ref
else {
class_addMethod(cls, selector, implementation, methodDescription.types);
}
@meftunca
How can I test it ?
Can you try adding back the following at FLEXUtility.mm , ref
else { class_addMethod(cls, selector, implementation, methodDescription.types); }
I'm trying to test.
@priteshrnandgaonkar It works!
@priteshrnandgaonkar @meftunca @diego-paired Hey guys. Please check your fix with @react-native-firebase/analytics. Looks like related https://github.com/invertase/react-native-firebase/issues/4935
I have put up the PR(https://github.com/facebook/flipper/pull/1943)
@meftunca
How can I test it ?
Can you try adding back the following at FLEXUtility.mm , refelse { class_addMethod(cls, selector, implementation, methodDescription.types); }I'm trying to test.
I have a problem with Network Plugin that cannot show response from Alamofire, I tried many times, but when I use this code, It's worked. 馃槀
Try using Flipper 0.78.0
Most helpful comment
Try using Flipper 0.78.0