Using Firebase Analytics in an ios app, on a phone and simulator using ios 15.4, XCode 13.2.1 (13C100) in a React Native app. The app itself works, but when I try to add unit tests, the test runner fails with the unrecognized selector problem. I have combed the issues on SO, they either ask for more info and die on the vine, or reference the same four issues on Firebase's github.
The Podfile (below) doesn't have use_frameworks! so it's unlikely that duplicate symbols are the culprit. I tried the one concrete piece of advice from the github issues, pod deintegrate
and recreate Podfile.lock, to no avail.
Here is the crash log, and below is the Podfile:
2022-02-01 17:59:06.733484-0800 ******[15233:34721677] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FBLPromise HTTPBody]: unrecognized selector sent to instance 0x600003d17db0'
*** First throw call stack:
(
0 CoreFoundation 0x000000011356eba4 __exceptionPreprocess 242
1 libobjc.A.dylib 0x000000010dee1be7 objc_exception_throw 48
2 CoreFoundation 0x000000011357d811 [NSObject(NSObject) instanceMethodSignatureForSelector:] 0
3 CoreFoundation 0x00000001135730ac ___forwarding___ 1433
4 CoreFoundation 0x00000001135751d8 _CF_forwarding_prep_0 120
5 ****** 0x00000001004111a0 -[GDTCCTUploadOperation updateNextUploadTimeWithResponse:forTarget:] 96
6 ****** 0x00000001004105ca __64-[GDTCCTUploadOperation sendURLRequestWithBatch:target:storage:]_block_invoke 74
7 ****** 0x000000010044ad65 __56-[FBLPromise chainOnQueue:chainedFulfill:chainedReject:]_block_invoke.67 85
8 ****** 0x000000010044a62a __44-[FBLPromise observeOnQueue:fulfill:reject:]_block_invoke_2 106
9 libdispatch.dylib 0x000000011147965a _dispatch_call_block_and_release 12
10 libdispatch.dylib 0x000000011147a83a _dispatch_client_callout 8
11 libdispatch.dylib 0x0000000111480f2d _dispatch_lane_serial_drain 1032
12 libdispatch.dylib 0x00000001114819d0 _dispatch_lane_invoke 400
13 libdispatch.dylib 0x000000011148c57d _dispatch_workloop_worker_thread 772
14 libsystem_pthread.dylib 0x0000000114c1745d _pthread_wqthread 314
15 libsystem_pthread.dylib 0x0000000114c1642f start_wqthread 15
)
libc abi: terminating with uncaught exception of type NSException
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/rmd6502/Library/Developer/Xcode/DerivedData/******-ezrzirhsblfqhfcbpxivqdehqlic/Build/Products/Debug-iphonesimulator DYLD_INSERT_LIBRARIES=/Users/rmd6502/Library/Developer/Xcode/DerivedData/******-ezrzirhsblfqhfcbpxivqdehqlic/Build/Products/Debug-iphonesimulator/******.app/Frameworks/libXCTestBundleInject.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib DYLD_FRAMEWORK_PATH=/Users/rmd6502/Library/Developer/Xcode/DerivedData/******-ezrzirhsblfqhfcbpxivqdehqlic/Build/Products/Debug-iphonesimulator
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FBLPromise HTTPBody]: unrecognized selector sent to instance 0x600003d17db0'
Podfile:
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '14.0'
target '******' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
pod 'RNInputMask', :path => '../node_modules/react-native-text-input-mask/ios/InputMask'
pod 'AFNetworking', :git => 'https://github.com/AFNetworking/AFNetworking.git', :commit => '4f3c694920ed0f5d3a8e180aacaf3af40c2efb4a'
pod 'Amplitude-iOS', '3.14.1'
pod 'EDQueue', :git => 'https://github.com/*****/queue.git', :commit => '06307feabc8893dee182732ed9f7662dcee2c4e8'
pod 'FMDB/standalone'
pod 'OpenCV2', '4.0.1'
pod 'TrueTime'
pod 'Firebase/Performance'
pod 'Firebase/ABTesting'
# pod 'Firebase/CoreOnly'
pod 'Firebase/MLVision'
pod 'FirebaseAnalytics'
pod 'GoogleMLKit/TextRecognition'
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
# based on https://github.com/facebook/flipper/commit/42325e41c5b7a7173281e57cdc3bfb9aee76340d
# TODO: add a RELEASE mode exemption too, or replace the CI check with it
# if !ENV['CI']
# use_flipper!({ 'Flipper' => '0.75.1', 'Flipper-Folly' => '2.6.7', 'Flipper-RSocket' => '1.4.3', 'Flipper-DoubleConversion' => '3.1.7', 'Flipper-Glog' => '0.3.9', 'Flipper-PeerTalk' => '0.0.4' })
# post_install do |installer|
# flipper_post_install(installer)
# # based on https://stackoverflow.com/a/37289688/1983583
# installer.pods_project.targets.each do |target|
# target.build_configurations.each do |config|
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
# end
# end
# end
# end
target '*****Tests' do
inherit! :complete
end```
CodePudding user response:
Firebase/MLVision
has been deprecated for a few years, so there may be some incompatible versions mixed into the app.
Best bet is to update to GoogleMLKit. If not that, you may be able to find compatible old versions by exploring the information in the generated Podfile.lock
.
CodePudding user response:
The actual issue was inherit! :complete
for the test target was duplicating the Promise library and causing the crash.