Updating iOS from React Native 0.59.x to 0.6x.x

Aung Myint Thein
4 min readJul 31, 2019

--

If you are trying to upgrade your RN app to 0.60.x, you might face some problems like me and I hope my codes and commands will be helpful for you.

In our project, we use
1. Firebase
2. Sentry
3. AsyncStorage
4. RNVectorIcons
5. Safariview and a few common ones.

Because of the lean core effort and auto-linking, I had to change my podfile as following:

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'project_name' do # Uncomment the next line if you're using Swift or would like to use dynamic frameworks # use_frameworks! pod 'Firebase/Core', '~> 6.2.0'
pod 'Firebase/Messaging', '~> 6.2.0'
pod 'Firebase/DynamicLinks', '~> 6.2.0'
pod 'Firebase/Performance', '~> 6.2.0'
pod 'Fabric', '~> 1.10.1'
pod 'Crashlytics', '~> 3.13.1'
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

pod 'SentryReactNative', :path => '../node_modules/react-native-sentry'
pod 'RNImageCropPicker', :path => '../node_modules/react-native-image-crop-picker'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'
pod 'react-native-netinfo', :path => '../node_modules/@react-native-community/netinfo'
pod 'react-native-safari-view', :path => '../node_modules/react-native-safari-view'
pod 'react-native-cameraroll', :path => '../node_modules/@react-native-community/cameraroll'
pod 'react-native-camera', path: '../node_modules/react-native-camera'
pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'RNSVG', :path => '../node_modules/react-native-svg'
pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'
target 'project_name' do
inherit! :search_paths
# Pods for testing
end
end

And this one helped me a lot too.

  1. Close Xcode and pack manger.

2. Clear Xcode Cache
rm -rf ~/Library/Developer/Xcode/DerivedData

3. Go into ios folder
cd ios

4. Clear CocoaPods Cache
pod deintegrate && pod cache clean --all
rm -rf Podfile.lock

5. Re-Install Pods
pod install

6. The install can take now a veeery long time — if it seems to be stuck, you should re-setup cocoa with an update before installing again, as follows:
gem install cocoapods (you maybe have to use sudo)
then
pod repo remove master --verbose && pod setup --verbose && pod install --verbose

7. then
pod install

I had to do these 7 steps a few times and credit goes to D1no.

I hope these commands will be helpful for you guys! Let me know if there are any problems and will try to help as much as possible.

Sometimes when you are getting duplicate symbols and all kind of errors, please try :

Delete all Link Binary With Libraries and run pod install fix it. (Credit to defghy)

Lottie

When you are using Lottie, it can give you a lot of troubles. The steps helped me solved the issues are as follow.

a) Please update your pod. sudo gem install cocoapods (Source: cocoapods) I was using 1.5.x but I cannot pod install lottie-react-native. I can install only after updated to 1.7.5.

b) You don’t need to install Lottie-iOS. It will be installed automatically.

c) BIG ISSUE with SWIFT. lottie-ios seem written in swift and your project may need to config a bit. Follow here.

d) Need to add Lottie.framework from this post.

Let me know if you need other issues.

If you are struggling with AndroidX’s multidex, here is an article for you: https://medium.com/@aungmt/multidex-on-androidx-for-rn-0-60-x-cbb37c50d85

--

--

Aung Myint Thein

Co-founder, CTO of a Myanmar EdTech startup www.myanlearn.com. Interested in data, statistics, programming, and psychology. Writing down codes and thoughts.