1

I'm working on React Native upgrade from RN0.59.10 to RN0.60.0 (Using Podfile)

From my package manager, version 5.5.6 is installed "react-native-firebase": "^5.5.6",

AND

here's what in my Podfile pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'

Firebase frameworks I have in my project]([![Firebase frameworks I have in my project

====================

I managed to build the project successfully however facing the issue below during run-time (when app launch)

+[FIRAnalytics setAnalyticsCollectionEnabled:]: unrecognized selector sent to class 0x10377e400

Following are tried on Simulator and Physical Device

  1. Tried to follow some solution from here

  2. Remove and re-append firebase frameworks under my project's Build Phases

    • FIRAnalyticsConnector.framework

The app is crashed at the following method within RNFirebase.xcodeproj > analytics > RNFirebaseAnalytics.m > RCT_EXPORT_METHOD

RCT_EXPORT_METHOD(setAnalyticsCollectionEnabled:(BOOL) enabled) {
  [FIRAnalytics setAnalyticsCollectionEnabled:enabled];
}

Here's the full crash log I get from xCode

2019-10-08 17:05:37.413335+0800 testApp[350:50876] +[FIRAnalytics setAnalyticsCollectionEnabled:]: unrecognized selector sent to class 0x10377e400
2019-10-08 17:05:37.430 [fatal][tid:com.facebook.react.RNFirebaseAnalyticsQueue] Exception '+[FIRAnalytics setAnalyticsCollectionEnabled:]: unrecognized selector sent to class 0x10377e400' was thrown while invoking setAnalyticsCollectionEnabled on target RNFirebaseAnalytics with params (
    1
)
callstack: (
    0   CoreFoundation                      0x0000000225e18edc <redacted> + 252
    1   libobjc.A.dylib                     0x0000000224fe9a40 objc_exception_throw + 56
    2   CoreFoundation                      0x0000000225d36ccc <redacted> + 0
    3   CoreFoundation                      0x0000000225e1e7dc <redacted> + 1412
    4   CoreFoundation                      0x0000000225e2048c _CF_forwarding_prep_0 + 92
    5   testApp                  0x000000010313b418 -[RNFirebaseAnalytics setAnalyticsCollectionEnabled:] + 64
    6   CoreFoundation                      0x0000000225e20630 <redacted> + 144
    7   CoreFoundation                      0x0000000225cfe450 <redacted> + 292
    8   CoreFoundation                      0x0000000225cff034 <redacted> + 60
    9   testApp                  0x00000001031e9b6c -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1896
    10  testApp                  0x00000001031ed568 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 660
    11  testApp                  0x00000001031ed0dc _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 144
    12  testApp                  0x00000001031ed040 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
    13  libdispatch.dylib                   0x0000000104657824 _dispatch_call_block_and_release + 24
    14  libdispatch.dylib                   0x0000000104658dc8 _dispatch_client_callout + 16
    15  libdispatch.dylib                   0x0000000104660e6c _dispatch_lane_serial_drain + 720
    16  libdispatch.dylib                   0x0000000104661b60 _dispatch_lane_invoke + 460
    17  libdispatch.dylib                   0x000000010466bbfc _dispatch_workloop_worker_thread + 1220
    18  libsystem_pthread.dylib             0x0000000225a350dc _pthread_wqthread + 312
    19  libsystem_pthread.dylib             0x0000000225a37cec start_wqthread + 4
)
2019-10-08 17:05:37.431276+0800 testApp[350:50876] Exception '+[FIRAnalytics setAnalyticsCollectionEnabled:]: unrecognized selector sent to class 0x10377e400' was thrown while invoking setAnalyticsCollectionEnabled on target RNFirebaseAnalytics with params (
    1
)
callstack: (
    0   CoreFoundation                      0x0000000225e18edc <redacted> + 252
    1   libobjc.A.dylib                     0x0000000224fe9a40 objc_exception_throw + 56
    2   CoreFoundation                      0x0000000225d36ccc <redacted> + 0
    3   CoreFoundation                      0x0000000225e1e7dc <redacted> + 1412
    4   CoreFoundation                      0x0000000225e2048c _CF_forwarding_prep_0 + 92
    5   testApp                  0x000000010313b418 -[RNFirebaseAnalytics setAnalyticsCollectionEnabled:] + 64
    6   CoreFoundation                      0x0000000225e20630 <redacted> + 144
    7   CoreFoundation                      0x0000000225cfe450 <redacted> + 292
    8   CoreFoundation                      0x0000000225cff034 <redacted> + 60
    9   testApp                  0x00000001031e9b6c -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1896
    10  testApp                  0x00000001031ed568 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 660
    11  testApp                  0x00000001031ed0dc _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 144
    12  testApp                  0x00000001031ed040 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
    13  libdispatch.dylib                   0x0000000104657824 _dispatch_call_block_and_release + 24
    14  libdispatch.dylib                   0x0000000104658dc8 _dispatch_client_callout + 16
    15  libdispatch.dylib                   0x0000000104660e6c _dispatch_lane_serial_drain + 720
    16  libdispatch.dylib                   0x0000000104661b60 _dispatch_lane_invoke + 460
    17  libdispatch.dylib                   0x000000010466bbfc _dispatch_workloop_worker_thread + 1220
    18  libsystem_pthread.dylib             0x0000000225a350dc _pthread_wqthread + 312
    19  libsystem_pthread.dylib             0x0000000225a37cec start_wqthread + 4
)

I do not expect any crash issue during the launch. Kindly share if you do spot any issue within my tries/way i implement.

Thank you.

Tommy Leong
  • 2,509
  • 6
  • 30
  • 54
  • Hello, I am using react-native 0.60.5 and i did not need to put pods libraries inside link with libraries since pods is already there and it handle them with auto linking. You also need to check if the libraries you are using needs additional configuration for react native 0.60.0 and link only pods doesn't support it yet. – André Pinto Oct 08 '19 at 12:45
  • Hello. What do you meant by "pod is already there and it handle them with auto linking"? AFAIK, only library that has *.podspecs will perform autolinking (pls correct me if im wrong). Anyway, from your experience of upgrading RN Framework.. how do you identify which libraries are require to be added in pod in your project? – Tommy Leong Oct 08 '19 at 14:00
  • Usually when you manually link a library you add it to Link Binary with Libraries. I check on their repository if it has updated with react-native, if not, I link it after upgrading and test if is still working, it really depends on each library. – André Pinto Oct 08 '19 at 15:57
  • In your working project, do you use RNFirebase as well? Can you show me how your podfile looks like? – Tommy Leong Oct 09 '19 at 02:51
  • yeah i use, check it out https://codepen.io/knivesq/pen/bGGdZmY – André Pinto Oct 09 '19 at 21:04
  • I'm curious why would you append ```pod 'Firebase/Analytics' and pod 'GoogleIDFASupport', '~> 3.14.0'```? In my case.. I do not have both them and I'm still able to track my GA. Tried adding both them, still don't solve my issue. – Tommy Leong Oct 10 '19 at 02:47
  • probably because i tried to implement firebase v6 before – André Pinto Oct 10 '19 at 13:42
  • Appreciate your help in participating this issue, thank you! – Tommy Leong Oct 11 '19 at 04:45

1 Answers1

0

Managed to resolved my own issue, please read my github issue to find more details.

TLDR;
Turns out my project holds some old Firebase frameworks which were appended in Link Binary with Libraries, hence the version was going back and forth (I guess this is the best explanation why I've been building successfully and failing from time to time)

Tommy Leong
  • 2,509
  • 6
  • 30
  • 54