Skip to content

Instantly share code, notes, and snippets.

@trunghieuvn
Last active March 31, 2022 04:27
Show Gist options
  • Save trunghieuvn/a91933cd11eff5b7443e0e35162599b0 to your computer and use it in GitHub Desktop.
Save trunghieuvn/a91933cd11eff5b7443e0e35162599b0 to your computer and use it in GitHub Desktop.
some compile error ios for react-native command cli

make sure version

brew install watchman
sudo gem install cocoapods

node

 node -v                                 
 v16.14.2

gem

 gem -v
3.0.3.1

watchman

watchman -v                                                               
2022.03.14.00

ruby

ruby -v
ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]

cocoapods

gem which cocoapods
/usr/local/Cellar/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods.rb

npx react-native init AwesomeTSProject --template react-native-template-typescript npx react-native start npx react-native run-ios

add to .bash_profile

 # new values
 export LDFLAGS="-L/usr/local/opt/bzip2/lib -L/usr/local/opt/zlib/lib"
 export CPPFLAGS="-I/usr/local/opt/bzip2/include -I/usr/local/opt/zlib/include"
brew upgrade cocoapods

facebook/react-native#25561

Fix build Android

nano .bash_profile

export ANDROID_HOME=/Users/macbookpro/DevTools/AndroidSDK
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH

/android local.properties sdk.dir = /Users/trunghieutran/DevTools/AndroidSDK

@trunghieuvn
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment