segment-integrations / analytics-ios-integration-firebase

Segment's bundled integration for Firebase on iOS
MIT License
13 stars 91 forks source link

-[FBLPromise HTTPBody]: unrecognized selector sent to instance #87

Closed jozsef-vesza-wm closed 1 year ago

jozsef-vesza-wm commented 2 years ago

Hello,

We've added Segment-Firebase to our Podfile recently. Since then we're experiencing crashes, like this one:

2022-02-23 17:14:15.653277+0100 MyApp [66578:1007593] -[FBLPromise HTTPBody]: unrecognized selector sent to instance 0x600001ec5c20
2022-02-23 17:14:15.654383+0100 MyApp [66578:1007593] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FBLPromise HTTPBody]: unrecognized selector sent to instance 0x600001ec5c20'
*** First throw call stack:
(
    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   GoogleDataTransport                 0x00000001124f1928 -[GDTCCTUploadOperation updateNextUploadTimeWithResponse:forTarget:] + 88
    6   GoogleDataTransport                 0x00000001124f0b89 __64-[GDTCCTUploadOperation sendURLRequestWithBatch:target:storage:]_block_invoke + 105
    7   FBLPromises                         0x00000001123a641e __56-[FBLPromise chainOnQueue:chainedFulfill:chainedReject:]_block_invoke.67 + 94
    8   FBLPromises                         0x00000001123a58cd __44-[FBLPromise observeOnQueue:fulfill:reject:]_block_invoke_2 + 109
    9   libdispatch.dylib                   0x000000011528c7ec _dispatch_call_block_and_release + 12
    10  libdispatch.dylib                   0x000000011528d9c8 _dispatch_client_callout + 8
    11  libdispatch.dylib                   0x0000000115294440 _dispatch_lane_serial_drain + 1222
    12  libdispatch.dylib                   0x0000000115294f67 _dispatch_lane_invoke + 439
    13  libdispatch.dylib                   0x00000001152a0de2 _dispatch_workloop_worker_thread + 882
    14  libsystem_pthread.dylib             0x00007fff6116845d _pthread_wqthread + 314
    15  libsystem_pthread.dylib             0x00007fff6116742f start_wqthread + 15
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Interestingly I also noticed these warnings popping up:

objc[66578]: Class GDTCCTCompressionHelper is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e030) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e2b0). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCCTUploadOperation is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e0a8) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e2d8). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCCTUploader is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e058) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e328). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCORClock is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e0f8) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e378). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCORDirectorySizeTracker is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e148) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e3c8). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCOREndpoints is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e1c0) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/ QA.app/MyApp (0x11002e440). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCOREvent is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e1e8) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e468). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCORFlatFileStorage is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e238) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e4b8). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCORLifecycle is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e288) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e508). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCORApplication is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e2d8) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e558). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCORReachability is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e328) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e5a8). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCORRegistrar is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e378) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e5f8). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCORStorageEventSelector is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e3c8) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e648). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCORTransformer is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e418) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e698). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCORTransport is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e468) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e6e8). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCORUploadBatch is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e4b8) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e738). One of the two will be used. Which one is undefined.
objc[66578]: Class GDTCORUploadCoordinator is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport (0x11251e508) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e788). One of the two will be used. Which one is undefined.
objc[66578]: Class GULHeartbeatDateStorage is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleUtilities.framework/GoogleUtilities (0x112577a70) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e7d8). One of the two will be used. Which one is undefined.
objc[66578]: Class GULHeartbeatDateStorageUserDefaults is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleUtilities.framework/GoogleUtilities (0x112577ac0) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e828). One of the two will be used. Which one is undefined.
objc[66578]: Class GULSecureCoding is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleUtilities.framework/GoogleUtilities (0x112577e08) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e8a0). One of the two will be used. Which one is undefined.
objc[66578]: Class GULKeychainStorage is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleUtilities.framework/GoogleUtilities (0x112577b10) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e8c8). One of the two will be used. Which one is undefined.
objc[66578]: Class GULKeychainUtils is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleUtilities.framework/GoogleUtilities (0x112577b88) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e940). One of the two will be used. Which one is undefined.
objc[66578]: Class GULURLSessionDataResponse is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleUtilities.framework/GoogleUtilities (0x112577e80) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e968). One of the two will be used. Which one is undefined.
objc[66578]: Class GULAppEnvironmentUtil is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/GoogleUtilities.framework/GoogleUtilities (0x112577a20) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002e9b8). One of the two will be used. Which one is undefined.
objc[66578]: Class FBLPromise is implemented in both /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/Frameworks/FBLPromises.framework/FBLPromises (0x1123ba880) and /Users/jvesza/Library/Developer/CoreSimulator/Devices/60054541-5ADD-43C6-BE9C-5107B3439E5E/data/Containers/Bundle/Application/EAAAFE22-0AA4-40BC-9F38-9ECE3929CE9C/MyApp.app/MyApp (0x11002ea08). One of the two will be used. Which one is undefined.

So my theory is that somehow the Firebase library is duplicated. I am using a number of analytics pods, including multiple Segment dependencies:

def analytics
    pod 'Analytics', '4.1.2'
    pod 'Segment-Adjust'
    pod 'Segment-Firebase'
    pod 'Appboy-iOS-SDK/InAppMessage'
    pod 'Segment-Appboy/Core'
    pod 'Apptimize'
end

I think I followed the installation steps correctly. I just

// ...

// Connect Segment to Firebase config.use(SEGFirebaseIntegrationFactory.instance())

// ...



So I'm not sure what I could do to fix this, I would appreciate any input, Thanks in advance!
wweevv-johndpope commented 1 year ago

related - https://stackoverflow.com/questions/67602772/app-is-keep-on-crashing-fblpromise-httpbody-unrecognized-selector-sent-to-inst

bsneed commented 1 year ago

Your app is including two different versions of firebase. The second one being imported via the Segment-Firebase integration likely. Remove the one from your app and use the one in the integration would be my suggestion.