Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native - iOS crashes when Flipper is upgraded above 0.69 #1940

Closed
diego-paired opened this issue Feb 17, 2021 · 15 comments
Closed

React Native - iOS crashes when Flipper is upgraded above 0.69 #1940

diego-paired opened this issue Feb 17, 2021 · 15 comments

Comments

@diego-paired
Copy link

馃悰 Bug Report

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

To Reproduce

  • Upgrade Flipper above 0.69 in a React Native application
  • Launch the application in an iOS simulator

Environment

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.

@priteshrnandgaonkar
Copy link
Contributor

Which Flipper version you used ? Did you use 0.75.1 ?

@diego-paired
Copy link
Author

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.

@meftunca
Copy link

I am having the same problem too.

@priteshrnandgaonkar
Copy link
Contributor

priteshrnandgaonkar commented Feb 19, 2021

@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.

@priteshrnandgaonkar
Copy link
Contributor

I tried reproducing on our example, and it didn't cause a crash.

Screen Shot 2021-02-19 at 5 11 57 PM

Can you provide an example to repro it ?

@priteshrnandgaonkar
Copy link
Contributor

priteshrnandgaonkar commented Feb 19, 2021

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

@priteshrnandgaonkar
Copy link
Contributor

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.

@meftunca
Copy link

I think the cause of the problem may be that we enable hermes in IOS.

@priteshrnandgaonkar
Copy link
Contributor

@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
Copy link

@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.

@meftunca
Copy link

@priteshrnandgaonkar It works!

@oxyii
Copy link

oxyii commented Feb 20, 2021

@priteshrnandgaonkar @meftunca @diego-paired Hey guys. Please check your fix with @react-native-firebase/analytics. Looks like related invertase/react-native-firebase#4935

@priteshrnandgaonkar
Copy link
Contributor

I have put up the PR(#1943)

@baveku
Copy link
Contributor

baveku commented Feb 21, 2021

@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.

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. 馃槀

facebook-github-bot pushed a commit that referenced this issue Feb 22, 2021
Summary:
This fixes the issue mentioned in #1940

## Changelog

Pull Request resolved: #1943

Test Plan: User confirmed

Reviewed By: mweststrate

Differential Revision: D26577560

Pulled By: priteshrnandgaonkar

fbshipit-source-id: dec4e34dcec4a3b3c20c11f0f2dc748fe2698693
@priteshrnandgaonkar
Copy link
Contributor

Try using Flipper 0.78.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants