LoginSignup
4
3

More than 3 years have passed since last update.

react-native run-ios で error Could not find "Podfile.lock" at のエラーが出た時の対処法

Last updated at Posted at 2020-06-21

概要 

react-native init <project name>

をした後に、

react-native run-ios

を実行すると、

error Could not find "Podfile.lock" at .....

のエラーが出た時の対処法。

解決コマンド

1 - cocoapods をインストールする

sudo gem install cocoapods

2 - 以下のコマンドを実行

cd ios && pod install && cd ../ && react-native run-ios

3 - もし上のコマンドで、pod install にエラーが出る場合、以下を実行

xcrun -k --sdk iphoneos --show-sdk-path

4 - この時にもし以下のエラーが出る場合

xcrun:_ error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'

5 - この場合は以下のコマンドを実行し、2のpod install コマンドを再度実行する。

sudo xcode-select --switch /Applications/Xcode.app

以上で

react-native run-ios

で無事エミュレータを起動することができた。

おわり。

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3