How to upgrade expo to the newest version in the ejected project

Serhii Onishchenko
2 min readApr 4, 2021

Here I’ll try to describe how to update the expo from 38 to 40 on the ejected project. Also, you can use this article if you try to upgrade the expo in the recommended way but it fails for you.

So the official documentation says that it’s very easy to update the expo. You just need to follow the steps described here: https://dev.to/expo/expo-sdk-40-is-now-available-1in0. Be aware that with expo upgrading you will upgrade react native and react. Here is a helper where you can see the difference between RN versions https://react-native-community.github.io/upgrade-helper/?from=0.62.2&to=0.63.4

For me, unfortunately, this type of upgrade failed. Because we had the ejected expo due to the several libs that needed to be manually installed on the android and ios projects. I received a lot of conflicts and after spending a lot of time, didn’t make it workable.

So, I have created a method of how to upgrade successfully. I hope it will be helpful and useful for you. Be aware that these instructions are not very strict and when you will follow them you will need to install native libraries from zero! I strongly recommend you to use official upgrade instructions.

  1. Delete android and ios folders. (We will generate a new after)
  2. Run expo upgrade to upgrade the expo to the latest version. Follow instructions in the console. In this step, we will update only expo ver.
  3. Run expo eject to eject your project again and generate new android and ios folders. In this step, we will update react-native, react, expo-updates, react-native-unimodules.
  4. After new ios and android folders will be generated you should again install all your ios and android frameworks and libraries. For me, it was only one lib, but in all cases, it will require changes in android and ios folders as you did before for your libs and settings.
  5. Also, I’ve deleted node_modules, package-lock.json, and ios/Podfile.lock. After that did npm i and pod install in the ios folder. It will generate for you new clear version configs.
  6. Follow the instruction of native libs installation which you are using for ios and android.
  7. To be sure that all configs will work as before I advise you to compare using your git next files. For android: android/build.gradle, android/app/build.gradle, android/app/src/main/AndroidManifest.xml, also do not forget to add android/app/debug.keystore. For ios: ios/Podfile. ios/project_name/Info.plist, ios/project_name/Supporting/Expo.plist. Also do not forget to check your app icon images and other files that need changes for your native libs.

In a summary, I should say that this update was not easy for me in the reason of installing all native libs and configuring the setting again. But, as a result, I received a clear project on the newest expo, react and react-native. Good luck!

--

--

Serhii Onishchenko

Hello! I'm JS developer who always tries to explore the tech world. In this blog I am sharing my personal experience.