invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.63k stars 2.2k forks source link

unrecognized selector error when calling user.sendEmailVerification and dynamicLinkDomain is set on iOS #3085

Closed r888888888 closed 4 years ago

r888888888 commented 4 years ago

Issue

When sending the verification email as part of the Firebase auth user creation, we pass along the action code settings. Among other things we set a dynamicLinkDomain key which was working in 6.1.0. Recently we started seeing this error:

2020-01-09 15:40:50.715830-0800 App[4828:1965424] -[__NSCFString stringValue]: unrecognized selector sent to instance 0x2827a1b00
2020-01-09 15:40:50.733 [fatal][tid:com.facebook.react.RNFBAuthModuleQueue] Exception '-[__NSCFString stringValue]: unrecognized selector sent to instance 0x2827a1b00' was thrown while invoking sendEmailVerification on target RNFBAuthModule with params (
    "[DEFAULT]",
        {
        android =         {
            packageName = "app";
        };
        dynamicLinkDomain = "app.page.link";
        handleCodeInApp = 1;
        iOS =         {
            bundleId = "com.app";
        };
        url = "https://app.com";
    },
    12624,
    12625
)

Some information has been sanitized.

This seems to be a regression caused by https://github.com/invertase/react-native-firebase/commit/42c20dbb4506bfb96b6cb1c23c8a01ea7a252664#diff-8cf0dc69a857a1b03cec1bb76724704bR1147

Specifically, dynamicLinkDomain is a string so there's no need to call stringValue on it.


Project Files

Javascript

Click To Expand

#### `package.json`: ```json { "name": "AnovaOven", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios --simulator \"iPhone 11\"", "start": "react-native start", "test": "jest", "lint": "eslint .", "format": "prettier --config .prettierrc.js --write \"src/**/*.{tsx,ts}\"", "ts": "tsc --skipLibCheck", "debugger": "open -g 'rndebugger://set-debugger-loc?port=8081'" }, "dependencies": { "@react-native-community/art": "^1.1.2", "@react-native-community/async-storage": "^2.0.0-rc.0", "@react-native-community/async-storage-backend-legacy": "^2.0.0-rc.0", "@react-native-community/google-signin": "^3.0.3", "@react-native-firebase/app": "^6.2.0", "@react-native-firebase/auth": "^6.2.0", "@react-native-firebase/crashlytics": "^6.2.0", "@react-native-firebase/dynamic-links": "^6.2.0", "@react-native-firebase/firestore": "^6.2.0", "@types/enzyme": "^3.10.3", "@types/jest": "^24.0.18", "@types/ramda": "^0.26.33", "@types/react-native-dotenv": "^0.2.0", "@types/react-native-fbsdk": "^1.0.0", "@types/react-native-video": "^3.1.5", "@types/react-test-renderer": "^16.9.0", "@types/url-parse": "^1.4.3", "@types/uuid": "^3.4.5", "date-fns": "^2.8.1", "eslint": "^6.6.0", "eslint-config-prettier": "^6.7.0", "eslint-plugin-jest": "^23.0.4", "eslint-plugin-prettier": "^3.1.1", "i18next": "^17.2.0", "ramda": "^0.26.1", "react": "16.9.0", "react-i18next": "^10.13.1", "react-native": "0.61.2", "react-native-elements": "^1.2.6", "react-native-fast-image": "^7.0.2", "react-native-fbsdk": "^1.0.4", "react-native-gesture-handler": "^1.4.1", "react-native-linear-gradient": "^2.5.6", "react-native-localize": "^1.3.0", "react-native-modal": "^11.5.3", "react-native-paper": "^3.1.1", "react-native-progress": "^4.0.3", "react-native-reanimated": "^1.3.0", "react-native-screens": "^2.0.0-alpha.4", "react-native-tab-view": "^2.11.0", "react-native-vector-icons": "^6.6.0", "react-native-video": "^5.0.2", "react-native-video-controls": "^2.4.0", "react-navigation": "^4.0.10", "react-navigation-stack": "^1.9.4", "react-navigation-tabs": "^2.5.6", "url-parse": "^1.4.7", "uuid": "^3.3.3", "wifi-manager": "file:wifi-manager" }, "devDependencies": { "@babel/core": "^7.6.2", "@babel/runtime": "^7.6.2", "@react-native-community/eslint-config": "^0.0.5", "@types/react": "^16.9.5", "@types/react-native": "^0.60.19", "babel-jest": "^24.9.0", "enzyme": "^3.10.0", "enzyme-adapter-react-16": "^1.15.1", "i18next-scanner": "^2.10.3", "jest": "^24.9.0", "jest-enzyme": "^7.1.1", "jsdom": "^15.2.0", "metro-react-native-babel-preset": "^0.56.0", "prettier": "1.18.2", "react-dom": "^16.10.2", "react-native-dotenv": "^0.2.0", "react-native-svg-asset-plugin": "^0.3.0", "react-native-typescript-transformer": "^1.2.13", "react-test-renderer": "16.9.0", "readdirp": "^3.2.0", "typescript": "^3.6.4", "wait-for-expect": "^3.0.0" }, "jest": { "preset": "react-native", "testPathIgnorePatterns": [ "pageObject\\.ts$", "pageObject\\.tsx$", "fixture\\.ts$" ], "transformIgnorePatterns": [ "node_modules/(?!((jest-)?react-native|react-navigation|react-navigation-drawer|@react-native-community/|@react-navigation/.*))" ], "setupFilesAfterEnv": [ "setup-tests.js" ] }, "prettier": { "semi": false } } ``` #### `firebase.json` for react-native-firebase v6: ```json # N/A ``` ### iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby platform :ios, '9.0' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' target 'app' do pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety" pod 'React', :path => '../node_modules/react-native/' pod 'React-Core', :path => '../node_modules/react-native/' pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules' pod 'React-Core/DevSupport', :path => '../node_modules/react-native/' pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/' pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon" pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga' pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' target 'appTests' do inherit! :search_paths # Pods for testing end use_native_modules! end ``` #### `AppDelegate.m`: ```objc /** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #import "AppDelegate.h" #import #import #import #import #import @import Firebase; @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { if ([FIRApp defaultApp] == nil) { [FIRApp configure]; } RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"AnovaOven" initialProperties:nil]; rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [UIViewController new]; rootViewController.view = rootView; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible]; return YES; } - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { if ([[FBSDKApplicationDelegate sharedInstance] application:app openURL:url options:options]) { return YES; } if ([RNGoogleSignin application:app openURL:url options:options]) { return YES; } return NO; } - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { #if DEBUG return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; #else return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; #endif } @end ```

--- ### Android
Click To Expand

#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [ ] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`: ```groovy // N/A ``` #### `android/app/build.gradle`: ```groovy // N/A ``` #### `android/settings.gradle`: ```groovy // N/A ``` #### `MainApplication.java`: ```java // N/A ``` #### `AndroidManifest.xml`: ```xml ```

--- ## Environment
Click To Expand

**`react-native info` output:** ``` System: OS: macOS 10.15.2 CPU: (8) x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz Memory: 783.56 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 Android SDK: API Levels: 28 Build Tools: 28.0.3 System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-Q | Google APIs Intel x86 Atom_64 IDEs: Android Studio: 3.5 AI-191.8026.42.35.5900203 Xcode: 11.3/11C29 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.2 => 0.61.2 ``` - **Platform that you're experiencing the issue on**: - [x] iOS - [ ] Android - [x] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - 6.2.0 - **`Firebase` module(s) you're using that has the issue:** - Auth - **Are you using `TypeScript`?** - Y 3.6.4

--- Think `react-native-firebase` is great? Please consider supporting all of the project maintainers and contributors by donating via our [Open Collective](https://opencollective.com/react-native-firebase/donate) where all contributors can submit expenses. [[Learn More]](https://invertase.io/oss/react-native-firebase/contributing/donations-expenses) - 👉 Check out [`React Native Firebase`](https://twitter.com/rnfirebase) and [`Invertase`](https://twitter.com/invertaseio) on Twitter for updates on the library.
mikehardy commented 4 years ago

unrecognized selectors always smell like code + pods + build caches out of sync Are you sure you're on latest pods? 6.14.0 Are you sure you've cleaned out all build caches? npx react-native-clean-project clean-project-auto && yarn && cd ios && pod install

r888888888 commented 4 years ago

Thanks for the suggestion. I've tried running those commands (also a git clean -fdx), running through the Xcode build again and I'm seeing the same error still.

mikehardy commented 4 years ago

it is actually somewhat new how to specify ios firebase sdk versions in react-native-firebase v6, but I can't see from the files you posted what exact version of the ios firebase sdk pods you are using. Can you alter you podfile like so: https://github.com/mikehardy/rnfbdemo/blob/master/make-demo-v6.sh#L30 to make absolutely certain you are using 6.14.0? (note it is 6.13.0 in that file, 6.14.0 is newer now and should be used)