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.45k stars 2.18k forks source link

🔥 [🐛] Build on iOS fails after installation of Analytics - No known class method for selector 'initiateOnDeviceConversionMeasurementWithPhoneNumber:' #7375

Closed ildaneta closed 7 months ago

ildaneta commented 7 months ago

Issue

Describe your issue here

Resume: After install "@react-native-firebase/analytics": "^18.5.0" my iOS build fails with error: No known class method for selector 'initiateOnDeviceConversionMeasurementWithPhoneNumber:'

⚠️ Only to keep in mind, I was already using firestore and auth in my project, and I needed to use remote-config, but as mentioned in the documentation, to use remote-config is mandatory install analytics, and after install analytics my build failed.

Steps: Following the documentation of https://rnfirebase.io/analytics/usage I installed:

# Install & setup the app module
yarn add @react-native-firebase/app

# Install the analytics module
yarn add @react-native-firebase/analytics

# If you're developing your app using iOS, run this command
cd ios/ && pod install

After that, I installed the firebase-ios-sdk as mentioned into firebase, the sdk version is v9.5, and I only installed FirebaseAnalyticsWithoutAdIdSupport because my main goal is utilize remote config, and the documentation says that is required to install analytics...

And then I put inside Podfile $RNFirebaseAnalyticsWithoutAdIdSupport = true and after cd ios && npx pod-install, this is the output:

Screenshot 2023-09-27 at 10 36 59

So, after it, when I tried build my project, the build fails as above:

Screenshot 2023-09-27 at 10 37 32


Project Files

Javascript

Click To Expand

#### `package.json`: ```json "dependencies": { "@hookform/resolvers": "^3.1.1", "@react-native-async-storage/async-storage": "1.17.11", "@react-native-firebase/analytics": "^18.5.0", "@react-native-firebase/app": "^18.3.0", "@react-native-firebase/auth": "^18.3.0", "@react-native-firebase/crashlytics": "^18.3.0", "@react-native-firebase/firestore": "^18.3.0", "@react-native-firebase/messaging": "^18.3.0", "@react-native-firebase/remote-config": "^18.3.0", "@react-navigation/drawer": "^6.6.3", "@react-navigation/native": "^6.1.7", "@react-navigation/native-stack": "^6.9.13", "@sentry/react-native": "4.15.2", "@types/react": "~18.0.27", "axios": "^1.4.0", "date-fns": "^2.30.0", "dotenv": "^16.3.1", "expo": "~48.0.18", "expo-constants": "~14.2.1", "expo-crypto": "~12.2.1", "expo-notifications": "^0.20.1", "expo-splash-screen": "~0.18.2", "expo-status-bar": "~1.4.4", "expo-system-ui": "~2.2.1", "i18next": "^23.4.4", "intl-pluralrules": "^2.0.1", "jest": "^29.2.1", "jest-expo": "^49.0.0", "lottie-react-native": "5.1.4", "mixpanel-react-native": "^2.3.1", "native-base": "^3.4.28", "react": "18.2.0", "react-hook-form": "^7.45.2", "react-i18next": "^13.0.3", "react-native": "0.71.8", "react-native-device-info": "^10.8.0", "react-native-gesture-handler": "^2.12.0", "react-native-localize": "^3.0.2", "react-native-reanimated": "2.14.4", "react-native-safe-area-context": "^4.7.1", "react-native-screens": "^3.22.1", "react-native-svg": "13.4.0", "typescript": "*", "yup": "^1.2.0", "zustand": "^4.3.9" }, "devDependencies": { "@babel/core": "^7.20.0", "@testing-library/jest-native": "^5.4.2", "@testing-library/react-native": "^12.1.3", "@types/jest": "^29.5.3", "@types/react-native": "^0.72.2", "@typescript-eslint/eslint-plugin": "^5.52.0", "eslint": "^8.0.1", "eslint-config-prettier": "^8.8.0", "eslint-config-standard-with-typescript": "^37.0.0", "eslint-plugin-import": "^2.25.2", "eslint-plugin-n": "^15.0.0 || ^16.0.0 ", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-promise": "^6.0.0", "eslint-plugin-react": "^7.33.0", "jest-transform-stub": "^2.0.0", "prettier": "^3.0.0", "react-native-svg-transformer": "^1.1.0" }, ``` #### `firebase.json` for react-native-firebase v6: ```json { "react-native": { "crashlytics_debug_enabled": false, "crashlytics_disable_auto_disabler": true, "crashlytics_auto_collection_enabled": true, "crashlytics_is_error_generation_on_js_crash_enabled": true, "crashlytics_javascript_exception_handler_chaining_enabled": true, "messaging_ios_auto_register_for_remote_messages": true } } ```

iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby use_frameworks! :linkage => :static $RNFirebaseAsStaticFramework = true $RNFirebaseAnalyticsWithoutAdIdSupport = true require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking") require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods") require File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules") require 'json' podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {} ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0' ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = '1' if podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR'] == 'true' platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0' install! 'cocoapods', :deterministic_uuids => false prepare_react_native_project! # If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set. # because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this, # you can also exclude `react-native-flipper` in `react-native.config.js` # # ```js # module.exports = { # dependencies: { # ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}), # } # } # ``` flipper_config = FlipperConfiguration.disabled if ENV['NO_FLIPPER'] == '1' then # Explicitly disabled through environment variables flipper_config = FlipperConfiguration.disabled elsif podfile_properties.key?('ios.flipper') then # Configure Flipper in Podfile.properties.json if podfile_properties['ios.flipper'] == 'true' then flipper_config = FlipperConfiguration.enabled(["Debug", "Release"]) elsif podfile_properties['ios.flipper'] != 'false' then flipper_config = FlipperConfiguration.enabled(["Debug", "Release"], { 'Flipper' => podfile_properties['ios.flipper'] }) end end target 'app' do use_expo_modules! config = use_native_modules! use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks'] use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS'] # Flags change depending on the env values. flags = get_default_flags() use_react_native!( :path => config[:reactNativePath], :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes', :fabric_enabled => flags[:fabric_enabled], # An absolute path to your application root. :app_path => "#{Pod::Config.instance.installation_root}/..", # Note that if you have use_frameworks! enabled, Flipper will not work if enabled :flipper_configuration => flipper_config ) post_install do |installer| react_native_post_install( installer, config[:reactNativePath], # Set `mac_catalyst_enabled` to `true` in order to apply patches # necessary for Mac Catalyst builds :mac_catalyst_enabled => false ) __apply_Xcode_12_5_M1_post_install_workaround(installer) # This is necessary for Xcode 14, because it signs resource bundles by default # when building for devices. installer.target_installation_results.pod_target_installation_results .each do |pod_name, target_installation_result| target_installation_result.resource_bundle_targets.each do |resource_bundle_target| resource_bundle_target.build_configurations.each do |config| config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' end end end end post_integrate do |installer| begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end end end ``` #### `AppDelegate.m`: ```objc #import "AppDelegate.h" #import #import #import @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // @generated begin @react-native-firebase/app-didFinishLaunchingWithOptions - expo prebuild (DO NOT MODIFY) sync-ecd111c37e49fdd1ed6354203cd6b1e2a38cccda [FIRApp configure]; // @generated end @react-native-firebase/app-didFinishLaunchingWithOptions self.moduleName = @"main"; // You can add your custom initial props in the dictionary below. // They will be passed down to the ViewController used by React Native. self.initialProps = @{}; return [super application:application didFinishLaunchingWithOptions:launchOptions]; } - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { #if DEBUG return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; #else return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; #endif } /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. /// /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). /// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`. - (BOOL)concurrentRootEnabled { return true; } // Linking API - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options { return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options]; } // Universal Links - (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray> * _Nullable))restorationHandler { BOOL result = [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler]; return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler] || result; } // Explicitly define remote notification delegates to ensure compatibility with some third-party libraries - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { return [super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; } // Explicitly define remote notification delegates to ensure compatibility with some third-party libraries - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { return [super application:application didFailToRegisterForRemoteNotificationsWithError:error]; } // Explicitly define remote notification delegates to ensure compatibility with some third-party libraries - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler]; } @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 // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { buildToolsVersion = findProperty('android.buildToolsVersion') ?: '33.0.0' minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21') compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '33') targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '33') if (findProperty('android.kotlinVersion')) { kotlinVersion = findProperty('android.kotlinVersion') } frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0' // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. ndkVersion = "23.1.7779620" } repositories { google() mavenCentral() } dependencies { classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2' classpath 'com.google.gms:google-services:4.3.15' classpath('com.android.tools.build:gradle:7.2.1') classpath('com.facebook.react:react-native-gradle-plugin') } } allprojects { repositories { maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url(new File(['node', '--print', "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), '../android')) } maven { // Android JSC is installed from npm url(new File(['node', '--print', "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), '../dist')) } google() mavenCentral() maven { url 'https://www.jitpack.io' } } } ``` #### `android/app/build.gradle`: ```groovy apply plugin: "com.android.application" apply plugin: "com.facebook.react" import com.android.build.OutputFile def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath() def expoDebuggableVariants = ['debug'] // Override `debuggableVariants` for expo-updates debugging if (System.getenv('EX_UPDATES_NATIVE_DEBUG') == "1") { react { expoDebuggableVariants = [] } } /** * This is the configuration block to customize your React Native Android app. * By default you don't need to apply any configuration, just uncomment the lines you need. */ react { entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", projectRoot, "android", "absolute"].execute(null, rootDir).text.trim()) reactNativeDir = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile() hermesCommand = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc" debuggableVariants = expoDebuggableVariants /* Folders */ // The root of your project, i.e. where "package.json" lives. Default is '..' // root = file("../") // The folder where the react-native NPM package is. Default is ../node_modules/react-native // reactNativeDir = file("../node_modules/react-native") // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen // codegenDir = file("../node_modules/react-native-codegen") // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js // cliFile = file("../node_modules/react-native/cli.js") /* Variants */ // The list of variants to that are debuggable. For those we're going to // skip the bundling of the JS bundle and the assets. By default is just 'debug'. // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. // debuggableVariants = ["liteDebug", "prodDebug"] /* Bundling */ // A list containing the node command and its flags. Default is just 'node'. // nodeExecutableAndArgs = ["node"] // // The command to run when bundling. By default is 'bundle' // bundleCommand = "ram-bundle" // // The path to the CLI configuration file. Default is empty. // bundleConfig = file(../rn-cli.config.js) // // The name of the generated asset file containing your JS bundle // bundleAssetName = "MyApplication.android.bundle" // // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' // entryFile = file("../js/MyApplication.android.js") // // A list of extra flags to pass to the 'bundle' commands. // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle // extraPackagerArgs = [] /* Hermes Commands */ // The hermes compiler command to run. By default it is 'hermesc' // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" // // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" // hermesFlags = ["-O", "-output-source-map"] } // Override `hermesEnabled` by `expo.jsEngine` ext { hermesEnabled = (findProperty('expo.jsEngine') ?: "hermes") == "hermes" } /** * Set this to true to create four separate APKs instead of one, * one for each native architecture. This is useful if you don't * use App Bundles (https://developer.android.com/guide/app-bundle/) * and want to have separate APKs to upload to the Play Store. */ def enableSeparateBuildPerCPUArchitecture = false /** * Set this to true to Run Proguard on Release builds to minify the Java bytecode. */ def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInReleaseBuilds') ?: false).toBoolean() /** * The preferred build flavor of JavaScriptCore (JSC) * * For example, to use the international variant, you can use: * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` * * The international variant includes ICU i18n library and necessary data * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that * give correct results when using with locales other than en-US. Note that * this variant is about 6MiB larger per architecture than default. */ def jscFlavor = 'org.webkit:android-jsc:+' /** * Private function to get the list of Native Architectures you want to build. * This reads the value from reactNativeArchitectures in your gradle.properties * file and works together with the --active-arch-only flag of react-native run-android. */ def reactNativeArchitectures() { def value = project.getProperties().get("reactNativeArchitectures") return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] } android { ndkVersion rootProject.ext.ndkVersion compileSdkVersion rootProject.ext.compileSdkVersion namespace 'com.ilda.app' defaultConfig { applicationId 'com.ilda.app minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0.0" } splits { abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK include (*reactNativeArchitectures()) } } signingConfigs { debug { storeFile file('debug.keystore') storePassword 'android' keyAlias 'androiddebugkey' keyPassword 'android' } } buildTypes { debug { signingConfig signingConfigs.debug } release { // Caution! In production, you need to generate your own keystore file. // see https://reactnative.dev/docs/signed-apk-android. signingConfig signingConfigs.debug shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false) minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } // applicationVariants are e.g. debug, release applicationVariants.all { variant -> variant.outputs.each { output -> // For each separate APK per architecture, set a unique version code as described here: // https://developer.android.com/studio/build/configure-apk-splits.html // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = defaultConfig.versionCode * 1000 + versionCodes.get(abi) } } } } // Apply static values from `gradle.properties` to the `android.packagingOptions` // Accepts values in comma delimited lists, example: // android.packagingOptions.pickFirsts=/LICENSE,**/picasa.ini ["pickFirsts", "excludes", "merges", "doNotStrip"].each { prop -> // Split option: 'foo,bar' -> ['foo', 'bar'] def options = (findProperty("android.packagingOptions.$prop") ?: "").split(","); // Trim all elements in place. for (i in 0.. 0) { println "android.packagingOptions.$prop += $options ($options.length)" // Ex: android.packagingOptions.pickFirsts += '**/SCCS/**' options.each { android.packagingOptions[prop] += it } } } dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") implementation(platform("com.google.firebase:firebase-bom:32.3.1")) implementation("com.google.firebase:firebase-analytics") def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true"; def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true"; def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true"; def frescoVersion = rootProject.ext.frescoVersion // If your app supports Android versions before Ice Cream Sandwich (API level 14) if (isGifEnabled || isWebpEnabled) { implementation("com.facebook.fresco:fresco:${frescoVersion}") implementation("com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}") } if (isGifEnabled) { // For animated gif support implementation("com.facebook.fresco:animated-gif:${frescoVersion}") } if (isWebpEnabled) { // For webp support implementation("com.facebook.fresco:webpsupport:${frescoVersion}") if (isWebpAnimatedEnabled) { // Animated webp support implementation("com.facebook.fresco:animated-webp:${frescoVersion}") } } implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0") debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { exclude group:'com.squareup.okhttp3', module:'okhttp' } debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") if (hermesEnabled.toBoolean()) { implementation("com.facebook.react:hermes-android") } else { implementation jscFlavor } } apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute(null, rootDir).text.trim(), "../native_modules.gradle"); applyNativeModulesAppBuildGradle(project) apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' ``` #### `android/settings.gradle`: ```groovy rootProject.name = 'Samplia' apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle"); useExpoModules() apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute(null, rootDir).text.trim(), "../native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' includeBuild(new File(["node", "--print", "require.resolve('react-native-gradle-plugin/package.json')"].execute(null, rootDir).text.trim()).getParentFile()) ``` #### `MainApplication.java`: ```java // N/A ``` #### `AndroidManifest.xml`: ```xml ```


Environment

Click To Expand

**`react-native info` output:** ``` expo-env-info 1.0.5 environment info: System: OS: macOS 12.5.1 Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.16.1 - ~/.nvm/versions/node/v18.16.1/bin/node Yarn: 1.22.19 - /usr/local/opt/node/v14.20.1/bin/yarn npm: 9.5.1 - ~/.nvm/versions/node/v18.16.1/bin/npm Watchman: 2022.10.10.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.12.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: API Levels: 30, 31, 33 Build Tools: 29.0.2, 30.0.3, 31.0.0, 33.0.0 System Images: android-27 | Google APIs ARM 64 v8a, android-28 | Google APIs ARM 64 v8a, android-28 | Google ARM64-V8a Play ARM 64 v8a, android-29 | Google APIs ARM 64 v8a, android-29 | Google Play ARM 64 v8a, android-30 | Google Play ARM 64 v8a, android-32 | Google Play ARM 64 v8a, android-33 | Google APIs ARM 64 v8a, android-33 | Google Play ARM 64 v8a IDEs: Android Studio: 2022.3 AI-223.8836.35.2231.10671973 Xcode: 14.2/14C18 - /usr/bin/xcodebuild npmPackages: expo: ~48.0.18 => 48.0.20 react: 18.2.0 => 18.2.0 react-native: 0.71.8 => 0.71.8 npmGlobalPackages: eas-cli: 5.0.2 expo-cli: 6.3.10 Expo Workflow: bare ``` - **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:** - ` "@react-native-firebase/app": "^18.3.0"` - **`Firebase` module(s) you're using that has the issue:** - `"@react-native-firebase/analytics": "^18.5.0"` - **Are you using `TypeScript`?** - `"typescript": "*"`


LaertHajdini commented 7 months ago

I was able to fix this issue by setting $FirebaseSDKVersion = '10.16.0' on the ios/Podfile

joekabogo commented 7 months ago

Getting the same issue

sanduluca commented 7 months ago

I was able to fix this issue by setting $FirebaseSDKVersion = '10.16.0' on the ios/Podfile

This helped me to fix it

kr-yeon commented 7 months ago

+1

Orest1996 commented 7 months ago

updated other packages from firebase (in my case were @react-native-firebase/messaging @react-native-firebase/app) reinstelled node_modules and ran pod install -repo-update,

mikehardy commented 7 months ago

initiateOnDeviceConversionMeasurementWithPhoneNumber is a new method in the firebase-ios-sdk

It was introduced in firebase-ios-sdk 10.13.0: https://firebase.google.com/support/release-notes/ios#version_10130_-_august_1_2023

It was first used in react-native-firebase in 18.5.0: https://github.com/invertase/react-native-firebase/blob/main/CHANGELOG.md

Note this:

https://github.com/invertase/react-native-firebase/commit/80ac07e207bad7f31a4805edb26e350f892fc5bf

Note: this implies transitive requirement of firebase-ios-sdk 10.13.0, if you override your firebase-ios-sdk version locally you must increase the local override version to at least 10.13.0 to adopt this version

And this from the related issue https://github.com/invertase/react-native-firebase/issues/7355#issuecomment-1726026196:

Versioning note: this could be considered a breaking change to add, as firebase-ios-sdk 10.10.0 was the minimum firebase-ios-sdk last required in a breaking change (https://github.com/invertase/react-native-firebase/blob/main/CHANGELOG.md#1810-2023-06-22)

On the other hand, the ability to override the firebase-ios-sdk version explicitly comes with a warning that it may cause problems, and you have to manage versions yourself so I'm leaning towards considering requirement of new minimum firebase-ios-sdk version to be a non-breaking change so we are free to add support for new APIs without friction (though with a good changelog comment from commit message...)

I feel this warning, present in the documentation about overrides, supports the stance that simply using new symbols is non-breaking change:

Using your own SDK versions is generally not recommended as it can lead to breaking changes in your application. Proceed with caution.

So, that settled (for me at least, though open to opinion...) this should be pretty trivial to add


Stated differently: anyone using the override accepts the risk of issues like this. We can and will adopt new features in the underlying SDKs and we expect that our inclusion of the new firebase-ios-sdk version in @react-native-firebase/app package.json should be sufficient. If you are overriding - contrary to our recommendation - the firebase-ios-sdk version you are responsible for bumping the version as our requirements change.

If that happens to you it will also have this "flavor" - that is, 1) you have a firebase-ios-sdk override or stale version somehow configured at the native level, and 2) your build breaks with an unknown symbol

Hopefully easy to fix for everyone here, and others in the future, but not something that we can change really with an action in this repository. We provide the firebase-ios-sdk version override "just in case" and we are happy to maintain it, but we cannot support issues that arise if people use it...

jihoon8730 commented 6 months ago

I was able to fix this issue by setting $FirebaseSDKVersion = '10.16.0' on the ios/Podfile

It works and anyone who installed the sdk package manually from xcode will have to clear the package for it to work!

harifxmaster commented 5 months ago

How to add in pod file .can you show a dommy setup

asaadxheikh commented 5 months ago
  1. Changed @react-native-firebase libraries version from 18.1.0 => 18.7.3
  2. and then in ios folder pod update

and it'll update all firebase pods

   "@react-native-firebase/analytics": "^18.7.3",
    "@react-native-firebase/app": "^18.7.3",
    "@react-native-firebase/messaging": "^18.7.3",
Screenshot 2023-12-19 at 6 51 22 PM
mikehardy commented 5 months ago

That looks odd - why are your Firebase pods not version-aligned to 10.19.0? They should all be 10.19.0+ if you are on react-native-firebase 18.7.3. It appears something is perturbing the resolution of the Pods and altering the versions that come in - I would not trust an app built with mis-matching Firebase pod versions like that

MuneebSajjad260 commented 1 month ago

im getting these errors 1.No known class method for selector 'initiateOnDeviceConversionMeasurementWithPhoneNumber:' 2.Use of undeclared identifier 'FIRConsentTypeAdUserData'; did you mean 'FIRConsentTypeAdStorage'? 3.Use of undeclared identifier 'FIRConsentTypeAdPersonalization'

first one is resolved by changing FirebaseSDKVersion to 10.16.0 and then pod update but second and third error is still there

ajeanjean-vivlio commented 1 month ago

im getting these errors 1.No known class method for selector 'initiateOnDeviceConversionMeasurementWithPhoneNumber:' 2.Use of undeclared identifier 'FIRConsentTypeAdUserData'; did you mean 'FIRConsentTypeAdStorage'? 3.Use of undeclared identifier 'FIRConsentTypeAdPersonalization'

first one is resolved by changing FirebaseSDKVersion to 10.16.0 and then pod update but second and third error is still there

Getting the same issue. Did you find a solution @MuneebSajjad260?

JeffGuKang commented 1 month ago

Update your Podfile as https://rnfirebase.io/#ios.

# Override Firebase SDK Version
$FirebaseSDKVersion = '10.24.0'
mikehardy commented 2 weeks ago

Update your Podfile as https://rnfirebase.io/#ios.

# Override Firebase SDK Version
$FirebaseSDKVersion = '10.24.0'

No, please don't do that unless you really need to

update react-native-firebase to current versions - that will also include firebase-ios-sdk but in a sustainable way so you do not end up stuck on an old firebase-ios-sdk version in the future after forgetting to update it manually...