Expo SDK 49 ExpoModulesCore Issues

As of today, I upgraded to Expo SDK 49 by following the instructions on the blog. After upgrading, I am encountering a lot of issues, specifically regarding ExpoModulesCore. Despite the installed package for my project as reported by npm is: expo-modules-core@1.5.8 (the latest version), when my program is being run on fastlane and compiling ExpoModulesCore on iOS pods, there are tons of bugs and issues. Here are the pictures:






package.json:

{
  "name": "yourhud",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "eject": "expo eject",
    "eas-build-pre-install": "umask 0077; echo machine api.mapbox.com login mapbox password \"XXX\" >~/.netrc"
  },
  "resolutions": {
    "@types/react": "17.0.14",
    "@types/react-dom": "17.0.14"
  },
  "dependencies": {
    "@config-plugins/react-native-ble-plx": "^6.0.0",
    "@expo-google-fonts/be-vietnam": "^0.2.0",
    "@expo-google-fonts/dev": "^0.2.0",
    "@expo-google-fonts/heebo": "^0.2.2",
    "@expo-google-fonts/hind-siliguri": "^0.2.2",
    "@expo-google-fonts/inter": "^0.2.2",
    "@expo-google-fonts/josefin-sans": "^0.2.2",
    "@expo-google-fonts/lato": "^0.2.2",
    "@expo-google-fonts/manrope": "^0.2.2",
    "@expo-google-fonts/michroma": "^0.2.0",
    "@expo-google-fonts/montserrat": "^0.2.0",
    "@expo-google-fonts/nunito": "^0.2.0",
    "@expo-google-fonts/open-sans": "^0.2.2",
    "@expo-google-fonts/orbitron": "^0.2.2",
    "@expo-google-fonts/oswald": "^0.2.2",
    "@expo-google-fonts/overpass": "^0.2.2",
    "@expo-google-fonts/poppins": "^0.2.2",
    "@expo-google-fonts/prompt": "^0.2.2",
    "@expo-google-fonts/public-sans": "^0.2.2",
    "@expo-google-fonts/quicksand": "^0.2.0",
    "@expo-google-fonts/raleway": "^0.2.0",
    "@expo-google-fonts/roboto-mono": "^0.2.2",
    "@expo-google-fonts/rubik": "^0.2.0",
    "@expo-google-fonts/varela-round": "^0.2.2",
    "@expo-google-fonts/work-sans": "^0.2.2",
    "@mapbox/polyline": "^1.1.1",
    "@miblanchard/react-native-slider": "^2.1.0",
    "@react-native-async-storage/async-storage": "1.18.2",
    "@react-native-community/cli-platform-ios": "^7.0.1",
    "@react-native-community/netinfo": "9.3.10",
    "@react-native-picker/picker": "2.4.10",
    "@react-navigation/drawer": "^6.1.8",
    "@react-navigation/material-top-tabs": "^6.0.6",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/native-stack": "^6.2.5",
    "@types/comma-number": "^2.1.0",
    "@types/haversine": "^1.1.5",
    "@types/mapbox__polyline": "^1.0.2",
    "@types/react-native-base64": "^0.2.0",
    "@types/react-native-linear-gradient": "^2.4.0",
    "@types/react-native-snap-carousel": "^3.8.5",
    "@use-expo/battery": "^2.0.0",
    "axios": "^0.24.0",
    "comma-number": "^2.1.0",
    "dotenv": "^10.0.0",
    "expo": "^49.0.5",
    "expo-av": "~13.4.1",
    "expo-battery": "~7.3.0",
    "expo-brightness": "~11.4.0",
    "expo-dev-client": "~2.4.6",
    "expo-device": "~5.4.0",
    "expo-font": "~11.4.0",
    "expo-in-app-purchases": "~14.3.0",
    "expo-keep-awake": "~12.3.0",
    "expo-linear-gradient": "~12.3.0",
    "expo-linking": "~5.0.2",
    "expo-location": "~16.1.0",
    "expo-network": "~5.4.0",
    "expo-notifications": "~0.20.1",
    "expo-permissions": "~14.2.1",
    "expo-sensors": "~12.3.0",
    "expo-speech": "~11.3.0",
    "expo-splash-screen": "~0.20.4",
    "expo-status-bar": "~1.6.0",
    "expo-task-manager": "~11.3.0",
    "haversine": "^1.1.1",
    "luxon": "^2.2.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.72.3",
    "react-native-anchor-point": "^1.0.6",
    "react-native-base64": "^0.2.1",
    "react-native-bouncy-checkbox": "^2.1.9",
    "react-native-color-matrix-image-filters": "^5.2.14",
    "react-native-confetti-cannon": "^1.5.2",
    "react-native-dotenv": "^3.3.1",
    "react-native-dropdown-picker": "^5.3.0",
    "react-native-email": "^1.1.0",
    "react-native-fs": "^2.19.0",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-google-mobile-ads": "^8.2.2",
    "react-native-google-places-autocomplete": "^2.4.1",
    "react-native-html-parser": "^0.1.0",
    "react-native-iap": "^12.3.2",
    "react-native-numeric-input": "^1.9.0",
    "react-native-pager-view": "6.2.0",
    "react-native-picker-select": "^8.0.4",
    "react-native-progress": "^5.0.0",
    "react-native-reanimated": "~3.3.0",
    "react-native-render-html": "^6.3.4",
    "react-native-responsive-fontsize": "^0.5.1",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-snap-carousel": "^3.9.1",
    "react-native-swiper": "^1.6.0",
    "react-native-tab-view": "^3.1.1",
    "react-native-toast-message": "^2.1.5",
    "react-native-track-player": "^2.1.3",
    "react-native-triangle": "^0.0.9",
    "react-native-web": "~0.19.6",
    "react-native-webview": "13.2.2",
    "react-native-youtube-iframe": "^2.2.2",
    "shortid": "^2.2.16",
    "use-places-autocomplete": "^1.11.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/jest": "^27.4.0",
    "@types/luxon": "^2.0.9",
    "@types/react": "~18.2.14",
    "@types/react-native": "~0.70.6",
    "@types/react-test-renderer": "^17.0.1",
    "@types/shortid": "^0.0.29",
    "typescript": "^5.1.3"
  },
  "private": true
}

I have no idea why there are so many issues with ExpoModulesCore is having so many issues with my project after upgrading to Expo SDK 49. Does anyone have any ideas how I can fix this? I really would like to have my project running. Thank you! @wodin

Hi @raamzeez

What do you get if you run npx expo-doctor?

I think you should remove the resolutions.

I believe all these should be devDependencies rather than dependencies.

I am pretty sure you should not have this installed and it could cause problems.

If you’re not using Expo to generate a Web version of your app you can remove these and the corresponding types.

Apparently this is deprecated and you might want to switch to Nano ID instead.

One other thing. Is this a managed app or a bare app? Do you have an ios directory in your app?

If it’s supposed to be a managed app, but you have an ios directory, then delete the ios directory to get back to the managed workflow.

1 Like

Hello! Thanks for the reply! When I run npx expo-doctor, all the checks are successful, and it tells me that it “Didn’t find any issues with the project!” I removed the resolutions, removed @react-native-community/cli-platform-ios, removed react-dom and react-native-web, and changed shortid to nanoid. I also moved all the @types/ packages that I had in the dependencies object into the devDependencies object. However, after making all these changes, I am getting the exact same error when building the project, which is in the pictures I attached originally. My project is a bare project, and it has the ios and android folders. Is there perhaps another thing that may be causing Expo Modules Core from failing to build when running in fastlane? I attached the updated package.json file. Thank you for your help:

{
  "name": "yourhud",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "eject": "expo eject",
    "eas-build-pre-install": "umask 0077; echo machine api.mapbox.com login mapbox password \"XXX\" >~/.netrc"
  },
  "dependencies": {
    "@expo-google-fonts/be-vietnam": "^0.2.0",
    "@expo-google-fonts/dev": "^0.2.0",
    "@expo-google-fonts/heebo": "^0.2.2",
    "@expo-google-fonts/hind-siliguri": "^0.2.2",
    "@expo-google-fonts/inter": "^0.2.2",
    "@expo-google-fonts/josefin-sans": "^0.2.2",
    "@expo-google-fonts/lato": "^0.2.2",
    "@expo-google-fonts/manrope": "^0.2.2",
    "@expo-google-fonts/michroma": "^0.2.0",
    "@expo-google-fonts/montserrat": "^0.2.0",
    "@expo-google-fonts/nunito": "^0.2.0",
    "@expo-google-fonts/open-sans": "^0.2.2",
    "@expo-google-fonts/orbitron": "^0.2.2",
    "@expo-google-fonts/oswald": "^0.2.2",
    "@expo-google-fonts/overpass": "^0.2.2",
    "@expo-google-fonts/poppins": "^0.2.2",
    "@expo-google-fonts/prompt": "^0.2.2",
    "@expo-google-fonts/public-sans": "^0.2.2",
    "@expo-google-fonts/quicksand": "^0.2.0",
    "@expo-google-fonts/raleway": "^0.2.0",
    "@expo-google-fonts/roboto-mono": "^0.2.2",
    "@expo-google-fonts/rubik": "^0.2.0",
    "@expo-google-fonts/varela-round": "^0.2.2",
    "@expo-google-fonts/work-sans": "^0.2.2",
    "@mapbox/polyline": "^1.1.1",
    "@miblanchard/react-native-slider": "^2.1.0",
    "@react-native-async-storage/async-storage": "1.18.2",
    "@react-native-community/netinfo": "9.3.10",
    "@react-native-picker/picker": "2.4.10",
    "@react-navigation/drawer": "^6.1.8",
    "@react-navigation/material-top-tabs": "^6.0.6",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/native-stack": "^6.2.5",
    "@use-expo/battery": "^2.0.0",
    "axios": "^0.24.0",
    "comma-number": "^2.1.0",
    "dotenv": "^10.0.0",
    "expo": "^49.0.0",
    "expo-av": "~13.4.1",
    "expo-battery": "~7.3.0",
    "expo-brightness": "~11.4.0",
    "expo-dev-client": "~2.4.6",
    "expo-device": "~5.4.0",
    "expo-font": "~11.4.0",
    "expo-in-app-purchases": "~14.3.0",
    "expo-keep-awake": "~12.3.0",
    "expo-linear-gradient": "~12.3.0",
    "expo-linking": "~5.0.2",
    "expo-location": "~16.1.0",
    "expo-network": "~5.4.0",
    "expo-notifications": "~0.20.1",
    "expo-permissions": "~14.2.1",
    "expo-sensors": "~12.3.0",
    "expo-speech": "~11.3.0",
    "expo-splash-screen": "~0.20.4",
    "expo-status-bar": "~1.6.0",
    "expo-task-manager": "~11.3.0",
    "haversine": "^1.1.1",
    "luxon": "^2.2.0",
    "nanoid": "^4.0.2",
    "react": "18.2.0",
    "react-native": "0.72.3",
    "react-native-anchor-point": "^1.0.6",
    "react-native-base64": "^0.2.1",
    "react-native-bouncy-checkbox": "^2.1.9",
    "react-native-color-matrix-image-filters": "^5.2.14",
    "react-native-confetti-cannon": "^1.5.2",
    "react-native-dotenv": "^3.3.1",
    "react-native-dropdown-picker": "^5.3.0",
    "react-native-email": "^1.1.0",
    "react-native-fs": "^2.19.0",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-google-mobile-ads": "^8.2.2",
    "react-native-google-places-autocomplete": "^2.4.1",
    "react-native-html-parser": "^0.1.0",
    "react-native-numeric-input": "^1.9.0",
    "react-native-pager-view": "6.2.0",
    "react-native-picker-select": "^8.0.4",
    "react-native-progress": "^5.0.0",
    "react-native-reanimated": "~3.3.0",
    "react-native-render-html": "^6.3.4",
    "react-native-responsive-fontsize": "^0.5.1",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-snap-carousel": "^3.9.1",
    "react-native-swiper": "^1.6.0",
    "react-native-tab-view": "^3.1.1",
    "react-native-toast-message": "^2.1.5",
    "react-native-track-player": "^2.1.3",
    "react-native-triangle": "^0.0.9",
    "react-native-webview": "13.2.2",
    "react-native-youtube-iframe": "^2.2.2",
    "shortid": "^2.2.16",
    "use-places-autocomplete": "^1.11.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/comma-number": "^2.1.0",
    "@types/haversine": "^1.1.5",
    "@types/jest": "^27.4.0",
    "@types/luxon": "^2.0.9",
    "@types/mapbox__polyline": "^1.0.2",
    "@types/react": "~18.2.14",
    "@types/react-native-base64": "^0.2.0",
    "@types/react-native-linear-gradient": "^2.4.0",
    "@types/react-native-snap-carousel": "^3.8.5",
    "@types/react-test-renderer": "^17.0.1",
    "@types/shortid": "^0.0.29",
    "typescript": "^5.1.3"
  },
  "private": true
}
1 Like

You still have these installed. I doubt they’re causing your compilation problems, though.

Can I ask why you need to use the Bare workflow?

If I install all of the above dependencies and devDependencies and add this to app.json then it builds fine for me:

  "react-native-google-mobile-ads": {
    "android_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx",
    "ios_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx"
  }

So it seems the problem is likely with the native project.

Thanks for the quick response! I have now removed shortid. The reason why I migrated to the bare workflow was because there were certain packages that I wanted to use that were not part of the Expo SDK. However, I did this migration well over a year ago, so it’s possible that things have changed or my understanding is not correct. Were you able to build the project on your computer with the managed workflow given the same packages that are in my package.json? Would going to managed workflow prevent me from using some of the packages? Maybe I can try going back to managed workflow and building again, since I don’t have any custom Swift or Java code that I wrote of my own that I am using or plan to use. Would that sound about right, and is it something easy to do? I do agree that the issue looks like it is part of the native project, which would be tricky to fix.

1 Like

Yes. Well, actually I used npx run:ios, which first runs npx expo prebuild in the background. This is similar to, but better than the old expo eject. So it basically converts your app to a Bare app anyway. But you can delete the ios and android directories to switch back to the Managed workflow.

Normally I just run eas build ... instead of npx expo run:*. If you do that, then it actually runs npx expo prebuild on the build server for managed apps. So all apps are either bare to begin with, or are converted to bare during the build process.

In case the above was not clear, I would do this:

  • Delete the ios and android directories to switch back to the Managed workflow.
  • Use eas build to build your app.
  • You can also build locally with eas build --local which works pretty much the same as eas build (it copies your app to a temporary directory and builds it there)
  • Or you can build with npx expo run:*, but if you do this you should clean up afterwards.

You might need to use config plugins for some things. You might have to write your own config plugins if a library you’re trying to use needs one, but the authors have not written it. (Not all native modules need a config plugin.)

If you need to write your own custom native code, look into Expo Modules.

This will simplify future upgrades.

Only if the above is not enough or you don’t have time to figure out Expo Modules, then you can use npx expo prebuild to generate the native projects and make whatever native changes you need to.

In theory you can use anything in a managed app that you could use in a bare app, but some things are more difficult than others. If a dependency only requires autolinking or pod install then you can just install it and create a new development build. If it needs more native config than that then you’ll need a config plugin. Ideally the authors or some third party will have already written the config plugin and you can just use it, but you might have to write one yourself.

I was able to build an app using your dependencies without needing any config plugins, but I didn’t check which of your dependencies might have optional config plugins.

Yes, that’s what I would do and it should be as easy as deleting your ios and android directories.

2 Likes

Sounds good, thank you very much! I deleted the ios and android folders, and then was able to successfully build the app with eas build. I was able to then download the development client and run the app. I initially encountered an issue that said “crypto was not defined” in my project, but turns out it was an issue with nanoid and react native. I was able to solve it with this link: Nanoid can't be used in react-native - Stack Overflow. That was it, and everything works well! Thanks so much again!

2 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.