React-native linking error while upgrading @react-native-firebase/app for use_frameworks podfile configuration

While upgrading react-native-firebase from version 5.x to latest version 17.x, there are some breaking changes done, we have to follow firebase documentation to upgrade to latest version.

While upgrading getting linking errors after following firebase configuration steps given in their documentation

Error: react native fbsdk Showing Recent Messages Undefined symbol: OBJC_CLASS$_RCTComponentEvent

Basically this error is coming because of changes done in podfile as given in firebase documentation a specific step mentioned as Altering CocoaPods to use frameworks

in this step it was mentioned that, Beginning with firebase-ios-sdk v9+ (react-native-firebase v15+) you must tell CocoaPods to use frameworks. Open the file ./ios/Podfile and add this line inside your targets:

use_frameworks!

but by doing above changes, it start affecting to many other libraries and started getting errors mentioned above.

Fix for the linking error

remove use_frameworks! from podfile targets section, instead add below lines in your pod file before your target in pod file

pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true

Basically we are setting modular headers only for firebase not for all solutions is given in this stack over flow post

yarn install does not create node_modules folder

when I upgraded yarn to latest version 3.4.1, I started facing strange issue in my react-native app. when i run yarn install, it does not throw any error but it ends with lots of warnings and does not create node_module folder

yarn recently introduced alternative installation strategy unveiled in September 2018, which is called as PnP which is nothing but ” Plug’n’Play “, because of this i started facing an issue, yarn install was not creating node_modules folder

yarn install node_modules folder not created – Yarn v3.0.2 Why do not install the node_modules folder

solution to this is in your project main directory, create a file “.yarnrc.yml” and add below line in that file

nodeLinker: node-modules

know more about yarn PnP here and the solution i have mentioned here is also described in this documentation page.

react-native version upgrade – Error: index.js: Cannot find module ‘babel-plugin-r’ React Native

after upgrading react-native-reanimated to latest version, I received babel error as follows

Error: index.js: Cannot find module 'babel-plugin-r' React Native

Solution for Error: index.js: Cannot find module ‘babel-plugin-r’ React Native

1. add below line of code in your babel.config.js file

plugins: [
    [
      '@babel/plugin-transform-runtime',
      {
          absoluteRuntime: false,
          corejs: false,
          helpers: true,
          regenerator: true,
          version: '7.0.0-beta.0',
      },
  ],
    'react-native-reanimated/plugin',
  ],

2. install below packages as dev dependencies

"@babel/core": "7.20.12",
"@babel/plugin-transform-runtime": "7.19.6",
"@babel/preset-env": "7.20.2",
"@babel/runtime": "7.20.13",

React-native migrating react-navigation from version 3.x.x to 6.x.x

While i started upgrading react-native from version 0.59.9 to 0.71.2 there were lot of drastic changes done across many libraries. react-navigation is one such which has some serious drastic changes.

Typical error we get while upgrading is

creating a navigator doesn’t take an argument maybe you are trying to use react navigation api 4

solution to this is

Using react-navigations as given in their documentation. the old code looks as follows for Stack Navigator

const Drawer = createStackNavigator({
MainNav: { screen: MainNav }
});

however the usage is changed now, all navigator functions now doesn’t require an argument , the changed code looks as follows

const DrawerStack = createStackNavigator();
function Drawer() {
  return (
    <DrawerStack.Navigator>
      <DrawerStack.Screen name="MainNav" component={MainNav} />
    </DrawerStack.Navigator>
  );
}

createDrawerNavigator code is also changed in version 6.x

old code looks as follows

const AppNavigator = createAppContainer(createDrawerNavigator({
  Drawer: { screen: Drawer }
},
  {
    drawerPosition: 'right',
    contentOptions: {
      activeTintColor: '#e91e63'
    },
    contentComponent: props => <SideBar {...props} />
  }));

changed createDrawerNavigator looks as follows

const DrawerNavigator = createDrawerNavigator();
const AppNavigator = () => {
  return (
    <DrawerNavigator.Navigator
      drawerPosition='right'
      tabBarActiveTintColor='#e91e63'
      drawerContent={props => <SideBar {...props} />}
    >
      <DrawerNavigator.Screen name="Drawer" component={Drawer} />
    </DrawerNavigator.Navigator>
  );
}

similarly all navigator functions like createBottomTabNavigator, NavigationContainer are updated follow latest version documentation

Upgrading react-native from version 0.59.9 to 0.71.2 build errors could not find compatible versions for pod “GTMSessionFetcher/Core”

While upgrading react-native from version 0.59.9 to 0.71.2, I am facing multiple build errors, no surprise that there is drastic changes happened from 0.59.9 to 0.71.2.

Error : CocoaPods could not find compatible versions for pod “GTMSessionFetcher/Core”

[!] CocoaPods could not find compatible versions for pod “GTMSessionFetcher/Core”:
In Podfile:
RNFBAuth (from ../node_modules/@react-native-firebase/auth) was resolved to 17.0.0, which depends on
Firebase/Auth (= 10.4.0) was resolved to 10.4.0, which depends on
FirebaseAuth (~> 10.4.0) was resolved to 10.4.0, which depends on
GTMSessionFetcher/Core (< 4.0, >= 2.1)

RNGoogleSignin (from `../node_modules/react-native-google-signin`) was resolved to 2.1.1, which depends on
  GoogleSignIn (~> 5.0.0) was resolved to 5.0.2, which depends on
    GTMSessionFetcher/Core (~> 1.1)

[!] Do not use “pod install” from inside Rosetta2 (x86_64 emulation on arm64).

[!] – Emulated x86_64 is slower than native arm64

[!] – May result in mixed architectures in rubygems (eg: ffi_c.bundle files may be x86_64 with an arm64 interpreter)

[!] Run “env /usr/bin/arch -arm64 /bin/bash –login” then try again.

Solution (fix) for CocoaPods could not find compatible versions for pod “GTMSessionFetcher/Core”

add below line on top of your pod file, this should be first line of your pod file

$FirebaseSDKVersion = ‘9.6.0’

Reference: thanks to Stackoverflow post

Upgrading react-native from version 0.59.9 to 0.71.2 build errors The Swift pod `FirebaseCoreInternal` depends upon `GoogleUtilities`Upgrading react-native from version 0.59.9 to 0.71.2 build errors

While upgrading react-native from version 0.59.9 to 0.71.2, I am facing multiple build errors, no surprise that there is drastic changes happened from 0.59.9 to 0.71.2.

Error

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod FirebaseCoreInternal depends upon GoogleUtilities, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies.

Solution (fix) error for FirebaseCoreInternal depends on GoogleUtilities

Add below lines in your pod file

platform :ios, min_ios_version_supported
….

pod ‘Firebase’, :modular_headers => true
pod ‘FirebaseCoreInternal’, :modular_headers => true
pod ‘GoogleUtilities’, :modular_headers => true


Reference- thanks to stackoverflow post

ReactNative – iOS Xcode 14 + MacOS X Ventura – build errors Duplicate Symbols for Architecture arm64

Building ReactNative Apps is always little hard when there is an Operating System Update along with that Xcode updated. Every time when Xcode is updated to a newer version, Apple make some changes which will start affecting iOS app build in ReactNative.

ReactNative iOS App build errors with Xcode 14 and Mac OS X Ventura

Recently when I updated Mac OS X Ventura, It also forced me to update Xcode to latest version 14. After Xcode update, my ReactNative App started failing with lots of errors. I have ReactNative app which is using RN version v0.59.9, Xcode started throwing linking errors like

42 Duplicate symbols for architecture arm64

the complete error looks as follows

duplicate symbol '_OBJC_CLASS_$_FBSDKBase64' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKBase64.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKBase64.o)
duplicate symbol '_OBJC_METACLASS_$_FBSDKBase64' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKBase64.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKBase64.o)
duplicate symbol '_OBJC_CLASS_$_FBSDKBasicUtility' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKBasicUtility.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKBasicUtility.o)
duplicate symbol '_OBJC_METACLASS_$_FBSDKBasicUtility' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKBasicUtility.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKBasicUtility.o)
duplicate symbol '_OBJC_CLASS_$_FBSDKCrashHandler' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKCrashHandler.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKCrashHandler.o)
duplicate symbol '_OBJC_METACLASS_$_FBSDKCrashHandler' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKCrashHandler.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKCrashHandler.o)
duplicate symbol '_OBJC_CLASS_$_FBSDKLibAnalyzer' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKLibAnalyzer.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKLibAnalyzer.o)
duplicate symbol '_OBJC_METACLASS_$_FBSDKLibAnalyzer' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKLibAnalyzer.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKLibAnalyzer.o)
duplicate symbol '_OBJC_CLASS_$_FBSDKTypeUtility' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKTypeUtility.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKTypeUtility.o)
duplicate symbol '_OBJC_METACLASS_$_FBSDKTypeUtility' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKTypeUtility.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKTypeUtility.o)
duplicate symbol '_OBJC_IVAR_$_FBSDKURLSession._session' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKURLSession.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKURLSession.o)
duplicate symbol '_OBJC_CLASS_$_FBSDKURLSession' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKURLSession.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKURLSession.o)
duplicate symbol '_OBJC_METACLASS_$_FBSDKURLSession' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKURLSession.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKURLSession.o)
duplicate symbol '_OBJC_IVAR_$_FBSDKURLSession._delegateQueue' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKURLSession.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKURLSession.o)
duplicate symbol '_OBJC_IVAR_$_FBSDKURLSession._delegate' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKURLSession.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKURLSession.o)
duplicate symbol '_OBJC_IVAR_$_FBSDKURLSessionTask._handler' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKURLSessionTask.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKURLSessionTask.o)
duplicate symbol '_OBJC_IVAR_$_FBSDKURLSessionTask._loggerSerialNumber' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKURLSessionTask.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKURLSessionTask.o)
duplicate symbol '_OBJC_IVAR_$_FBSDKURLSessionTask._task' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKURLSessionTask.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKURLSessionTask.o)
duplicate symbol '_OBJC_CLASS_$_FBSDKURLSessionTask' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKURLSessionTask.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKURLSessionTask.o)
duplicate symbol '_OBJC_METACLASS_$_FBSDKURLSessionTask' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKURLSessionTask.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKURLSessionTask.o)
duplicate symbol '_OBJC_IVAR_$_FBSDKURLSessionTask._requestStartDate' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKURLSessionTask.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKURLSessionTask.o)
duplicate symbol '_OBJC_IVAR_$_FBSDKURLSessionTask._requestStartTime' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKURLSessionTask.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKURLSessionTask.o)
duplicate symbol '_FBSDKAppEventCity' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKAppEvents.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKUserDataStore.o)
duplicate symbol '_FBSDKAppEventCountry' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKAppEvents.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKUserDataStore.o)
duplicate symbol '_FBSDKAppEventGender' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKAppEvents.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKUserDataStore.o)
duplicate symbol '_FBSDKAppEventZip' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKAppEvents.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKUserDataStore.o)
duplicate symbol '_FBSDKAppEventEmail' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKAppEvents.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKUserDataStore.o)
duplicate symbol '_FBSDKAppEventDateOfBirth' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKAppEvents.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKUserDataStore.o)
duplicate symbol '_FBSDKAppEventState' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKAppEvents.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKUserDataStore.o)
duplicate symbol '_OBJC_CLASS_$_FBSDKUserDataStore' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKUserDataStore.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKUserDataStore.o)
duplicate symbol '_OBJC_METACLASS_$_FBSDKUserDataStore' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKUserDataStore.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKUserDataStore.o)
duplicate symbol '_FBSDKAppEventPhone' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKAppEvents.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKUserDataStore.o)
duplicate symbol '_FBSDKAppEventFirstName' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKAppEvents.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKUserDataStore.o)
duplicate symbol '_FBSDKAppEventLastName' in:
    /Users/xyz/Library/Developer/Xcode/DerivedData/MyProject-bmkdjxadfihkgxdpmjllovjakstn/Build/Products/Release-iphoneos/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKAppEvents.o)
    /Users/xyz/MyComputer/Development/MyProject/SourceCode/MyBranches/saz_mobile/mobile_rn_dev/sazappmobile/MyProject/ios/Pods/FacebookSDK/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics(FBSDKUserDataStore.o)
ld: 42 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

When I started looking for solution, I found multiple solutions, which actually worked for many people, however for me none of those solutions worked.

Solution for Duplicate Symbols for architecture arm64 – which worked for me

Steps to resolve

  1. Open your project in Xcode
  2. Click on Pods project from your project navigator as shown in below diagram
    then select Build Phases and select the project target in which you are getting errors. For me all linking errors were for FBSDKCore, you can find that by seeing the error.

  3. Then from error get the file name for which you are getting duplicate symbol. for example if error has
    duplicate symbol ‘_FBSDKAppEventLastName’ in: /libFBSDKCoreKit.a(FBSDKAppEvents.o)
    Then find file FBSDKAppEvents.m from the search box given in above screenshot.
  4. Find the file and select the file and delete by clicking on delete(-) icon in the Xcode. ( refer below screenshot)
  5. Since in my case there are 42 linking errors, all the errors are coming from more than 4 to 5 different files. I deleted all the files one by one.
  6. This resolved all 42 linking error.

Basically the error appears when same implementation is referenced more than one in the project. Which mean in my case some of the .m files from FBSDKCoreKit are added more than once, it is difficult to find how those files added twice, but usually it happens when libraries are linked through pods as well as manually ( typically in old projects libraries might have also linked using ReactNative link command)

Now question is why Xcode 14 started giving errors? which was not the case earlier with lower version of Xcodes ? this is basically because the latest Xcode checks strictly many things and it starts complaining.

Is it the only solution which fix this issue ? well that I am not sure, there are many more solutions giving in StackOverflow as well as GitHub, some fixes might work for you. Here are those references for you, in case my fix doesn’t work for you 🙂

References:

1. Github Post- duplicate symbols for architecture x86_64 React Ntaive version 0.64 #32016

2. Github Post – duplicate symbols for architecture x86_64 React Ntaive

3. Stack over flow post – Duplicate Symbols for Architecture arm64

Useful ReactJS, NodeJS,Architecture,Programming Tutorials, videos, links

AirBnB ReactJS front-end Performance Fixes

React Performance Fixes on Airbnb Listing Pages, AirBnb worked hard to improve performance of their listing pages, Thanks to their TechBlog which has covered extensive, detailed explanation regarding how they have improved the performance

Reference Link: React Performance Fixes on Airbnb Listing Pages

System Design Resources

System design is a key to any highly scalable, Large scale Softwares, which deals with Entire System Architecture that focus on Performance, scalability, security, stability of the system. Here are few important resource references

Facebook Video Broadcasting: under-the-hood-broadcasting-live-video-to-millions

Netflix Video Encoding at Scale: high-quality-video-encoding-at-scale

Netflix Workflow Orchestration for Microservices: Netflix-Conductor

Practical System Design

YouTube Architecture: youtube-architecture

YouTube scalability 2012: Youtube-Scalability

Distributed Design Patterns: Scalable-system-design-patterns

Circuit Breaker Algorithm: Handling failures in Backend to Backend calls

Uber Rate Limiter: RateLimit

Intra-Service Messaging

AirBnb Idempotency: avoiding-double-payments-in-a-distributed-payments-system

And Many more useful resources are given in below github link

https://github.com/InterviewReady/system-design-resources

Resolving Duplicate class error in React Native Android while integrating Native Modules

What is a Duplicate Class issue?

React native has evolved so much that you will really get helpful docs on external packages for most of the things. But there are some corner cases for which we do not find the npm modules to integrate. In those cases, we have to integrate SDK/package in the native side and then write a bridging code in order to call it from React-Native JS code.
  As your project grows and as you start integrating the new SDKs you will somewhere end up with this issue, “Duplicate class” in android. Basically, this issue says this module is already included in one of the SDK and the new SDK we are including also has the same modules and same classes and its a run time java error
  I was so panicked about this issue since I had got a big list of duplicate class issues as you see in the below image and error text below.

Java.lang.RuntimeException: Duplicate class 

com.google.android.gms.dynamite.descriptors.com.google.android.gms.vision.dynamite.face.ModuleDescriptor found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)


  Duplicate class com.google.android.gms.internal.vision.zzca found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar 

(com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)


  Duplicate class com.google.android.gms.internal.vision.zzcb found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)

  Duplicate class com.google.android.gms.internal.vision.zzcc found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)


  Duplicate class com.google.android.gms.internal.vision.zzcd found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)


  Duplicate class com.google.android.gms.internal.vision.zzce found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)


  Duplicate class com.google.android.gms.internal.vision.zzci found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)


  Duplicate class com.google.android.gms.internal.vision.zzcj found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)


  Duplicate class com.google.android.gms.internal.vision.zzck found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar 

(com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)


  Duplicate class com.google.android.gms.internal.vision.zzcl found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)


  Duplicate class com.google.android.gms.internal.vision.zzcm found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)


  Duplicate class com.google.android.gms.internal.vision.zzl found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-20.1.3-runtime.jar (com.google.android.gms:play-services-vision:20.1.3)


  Duplicate class com.google.android.gms.vision.face.ChimeraNativeBaseFaceDetectorCreator found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)


  Duplicate class com.google.android.gms.vision.face.FaceDetectorV2Jni found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)


  Duplicate class com.google.android.gms.vision.face.NativeFaceDetectorImpl found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)

Solution for Duplicate Class Error in React Native

Do not worry about the big error message, basically, everything is a single issue but android is making us complicated in presenting. The solution to this issue is very simple but you need to understand the issue properly. Without understanding the issue and just trying with StackOverflow and Github answers it took about a week to fix this.
You will find plenty of the answers in GitHub and StackOverflow for this issue and, they are correct, but they have not elaborated the answer and think that people from the android background can solve this easily. But if you do not know much about the android part then please have a look at this solution.
For integrating a new SDK I got so many duplicate class issues as my project was big and had already many SDKs. In my list of Duplicate class issues, ALl issues are the same but for different modules. I will just one and explain about it.

Duplicate class com.google.android.gms.dynamite.descriptors.com.google.android.gms.vision.dynamite.face.ModuleDescriptor found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2) and jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)

So error says that there is a duplicate class in these two modules
Module1: com.google.android.gms.dynamite.descriptors.com.google.android.gms.vision.dynamite.face.ModuleDescriptor found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar(com.google.firebase:firebase-ml-vision-face-model:17.0.2)
Module 2:
jetified-play-services-vision-face-contour-internal-16.1.0-runtime.jar (com.google.android.gms:play-services-vision-face-contour-internal:16.1.0)

https://github.com/react-native-camera/react-native-camera/issues/3031#issuecomment-732135774

https://stackoverflow.com/questions/58808875/how-to-resolve-duplicate-class-exception-caused-by-com-google-firebasefirebase

As per the answers I found from Github, We need the exclude one of the groups and module from one of the modules and remember not both of them.

implementation platform('com.google.firebase:firebase-bom:26.1.0'){
exclude group: 'com.google.android.gms'
}

The hardest part for me with an issue I found was identifying which one is a module and which one is a group. That’s why it took me a week to find the solution. If you know which one is module and group then it just works with one shot.
Now we know that out of two modules we need to exclude only one module and not both. Considering the first module out of two.
com.google.android.gms.dynamite.descriptors.com.google.android.gms.vision.dynamite.face.ModuleDescriptor found in modules jetified-firebase-ml-vision-face-model-17.0.2-runtime.jar(com.google.firebase:firebase-ml-vision-face-model:17.0.2)
In this part we need to identify module and the group to exclude,
Now consider only this part com.google.firebase:firebase-ml-vision-face-model:17.0.2
Module: com.google.firebase
Group: firebase-ml-vision-face-model

The rest of the description and version numbers and all just ignore it.
Now go to your android app/build.gradle and exclude this module configuration

That’s it. Re-run your project and you will find this issue anymore

Posted by:
Anand S,
Software Engineer, NIUM India Pvt Ltd

Notes on Startup – Foundations – Team is Very Important

“Thiel’s Law”: A Startup messed up at its foundation cannot be fixed.

Beginnings are special, they are qualitatively different from all that comes afterward. This was true 13.8 billion years ago, at the founding of our cosmos: something very special happened and universe began to expand and went on to expand by the factor of 10^30 – a million trillion trillion.

Once a country is formed its hard to change constitution, united states since its freedom, after 1791 change it has amended the constitution only 17 times.

Companies are like countries in this way. Bad decisions made early on – if you choose the wrong partners or hire the wrong people, for example – are very hard to correct after they are made. It may take a crisis on the order of bankruptcy before anybody will even try to correct them.

You can not build a great company on a flawed foundation

Founding Matrimony – A Startup starting with – A Team

Image credits https://www.vrfocus.com/

When you start something the first and most crucial decision you make is whom to start it with. Choosing a co-founder is like getting married and founder conflict is just as ugly as divorce. A wise investor will always first study the team, either the investor or a founder what matters most is the team to begin with.

Its not just a founder who need to get along. Everyone in your company needs to work well together. Its very hard to go from 0 to 1 without a team.

Team Culture for a Successful Startup

What would the ideal company culture look like? Employees should love their work. They should enjoy going to the office so much that formal business hours become obsolete and nobody watches the clock, workers should feel at home.

Recruiting is a core competency for any company. It should never be outsourced. You need people who are not just skilled on paper but who will work together cohesively after they are hired. The first four or five might be attracted by large equity stakes or high profile responsibility. More important than those obvious offerings is your answer to this question: Why should the 20th employee join your company?

Talented people no need to work for you, they have better options out with better offerings, hence as a founder we have to ask ourselves why some one should join my company? some of the bad answers are “Your stock options are better than others”, “You will get to work with smartest people in the world”, “You can help solve the world’s most challenging problems”. The only good answer is specific to your company. The good answers are about your mission and about your team.

Reference: Book Zero To One By Peter Thiel