Do we need to run `pod install` with React Native 0.60?

gkeenley picture gkeenley · Sep 13, 2019 · Viewed 34.5k times · Source

I'm using React Native 0.60.5 and am linking this module. It says that for React Native 0.60+, "CLI autolink feature links the module while building the app", so all we need to run is yarn add @react-native-community/async-storage.

However, on the main page describing autolinking it says that we need to run:

yarn add @react-native-community/async-storage cd ios && pod install && cd ..

What I Want To Know:

Do we have to run pod install for all native modules with React Native 0.60+?

Answer

Mehran Khan picture Mehran Khan · Sep 14, 2019

There are 2 types of linking in react-native

1 ) Manual linking

2 ) Pod linking

As described in official site

"If your iOS project is using CocoaPods (contains Podfile) and linked library has "podspec file", then react-native link will link library using Podfile."

Now when you

 react-native link

If you project has CocoaPods (contains Podfile) and linked library has podspec file then it will add pod path of linked library in podfile like this

pod 'RNImageCropPicker', :path =>  '../node_modules/@react-native-community/async-storage'

But you still have to run pod install command

If project does not have pod file or linked library does not have podspec file then you have to do manual linking as described in site

Now coming to question from react-native 0.60 this process is now automatic. You do not have to run "react-native link " . It will automatically do pod work for you when you install library using npm/yarn but still you have to run "pod install" command