skip to Main Content

Description of the Problem:
When running pod install –no-repo-update in my React Native project, I observed that certain existing dependencies were removed during the process.

  1. Downloading dependencies
  • Installing AppAuth 1.6.2 (was 1.4.0)/n
  • Installing Firebase 6.34.0
  • Installing GTMAppAuth 1.3.1 (was 1.2.2)
  • Installing GTMSessionFetcher 1.7.2 (was 1.7.0)
  • Installing GoogleUtilities 6.7.2
  • Installing Protobuf 3.25.2 (was 3.19.4)
  • Installing RNSVG 12.5.1 (was 12.3.0)
  • Installing lottie-ios (3.1.9)
  • Installing lottie-react-native (3.5.0)
  • Installing react-native-camera 3.44.3
  • Removing BVLinearGradient
  • Removing FirebaseAnalytics
  • Removing FirebaseAuth
  • Removing FirebaseDynamicLinks
  • Removing FirebaseInstanceID
  • Removing FirebaseMessaging
  • Removing FirebaseStorage
  • Removing GoogleAppMeasurement
  • Removing RNAppleAuthentication
  • Removing RNCAsyncStorage
  • Removing RNCMaskedView
  • Removing RNCPicker
  • Removing RNDateTimePicker
  • Removing RNDeviceInfo
  • Removing RNFBAnalytics
  • Removing RNFBAuth
  • Removing RNFBDynamicLinks
  • Removing RNFBMessaging
  • Removing RNFBStorage
  • Removing RNFastImage
  • Removing RNReactNativeHapticFeedback
  • Removing RNScreens
  • Removing SDWebImage
  • Removing SDWebImageWebPCoder
  • Removing Toast
  • Removing libwebp
  • Removing react-native-apple-authentication
  • Removing react-native-blur
  • Removing react-native-geolocation
  • Removing react-native-image-picker
  • Removing react-native-maps
  • Removing react-native-safe-area-context
  • Removing react-native-simple-toast
  • Removing react-native-slider
  • Removing react-native-version-check
  • Removing react-native-webview
    Generating Pods project

Why are existing dependencies being removed during the ‘pod install’ process?, Is there a way to prevent the removal of specific dependencies?

2

Answers


  1. Chosen as BEST ANSWER

    require_relative '../node_modules/react-native/scripts/react_native_pods'
    require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
    
    platform :ios, '10.0'
    
    target '' do
    
    
    rn_maps_path = '../node_modules/react-native-maps'
    pod 'react-native-google-maps', :path => rn_maps_path
      config = use_native_modules!
    
      use_react_native!(:path => config["reactNativePath"])
    
    
      pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
    
    
      pod 'RNSVG', :path => '../node_modules/react-native-svg'
    
      pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
    
      pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
    
      pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'
    
      pod 'react-native-viewpager', :path => '../node_modules/@react-native-community/viewpager'
    
      pod 'RNSound', :path => '../node_modules/react-native-sound'
    
      pod 'ReactNativeGetLocation', :path => '../node_modules/react-native-get-location'
      pod 'react-native-camera', path: '../node_modules/react-native-camera', subspecs: [
        'BarcodeDetectorMLKit'
      ]
    
      target '' do
        inherit! :complete
        # Pods for testing
      end
    
      # Enables Flipper.
      #
      # Note that if you have use_frameworks! enabled, Flipper will not work and
      # you should disable these next few lines.
      use_flipper!({'Flipper' => '0.87.0' , 'Flipper-Folly' => '2.5.3' , 'Flipper-RSocket' => '1.3.1' })
      post_install do |installer|
        flipper_post_install(installer)
      end
    end


  2. Yes, you have to define the exact dependency version.

    e.g.

    pod 'Alamofire', '~> 5.0' 
    

    means install the Alamofire having version 5.0 or later. So every time you run pod install it will try to install the latest compatible version.

     pod 'Alamofire', '5.0' 
    

    This means install the exactly the 5.0 version even if new version is available. It will not change the lib version.

     pod 'Alamofire'
    

    This means install the latest version compatible to your pod version.

    So basically you have to remove ~> sign before the library version number.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search