expo: No such module 'ExpoModulesCore'

Summary

I decided to use https://docs.expo.dev/versions/latest/sdk/securestore/

I have installed expo modules with : npx install-expo-modules@latest

Everything went well.
When trying to run IOS app I get multiple errors, one of those errors:

/ios/Pods/Target Support Files/Pods-VanBruggen/ExpoModulesProvider.swift:8:8: No such module ‘ExpoModulesCore’

The app works well on android. What I checked:

  • I tried to follow manual installation and check if all code has been applied properly and it did.
  • Reinistalling node modules
  • Removing Pods and Podfile.lock and reinstalling with pod install
  • Restarting laptop.

I have noticed that my IOS deployment target had to be changed to 12 from 11.

Any ideas? Thank you.

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

bare

What platform(s) does this occur on?

iOS

SDK Version (managed workflow only)

No response

Environment

expo-env-info 1.0.3 environment info: System: OS: macOS 11.5.2 Shell: 5.8 - /bin/zsh Binaries: Node: 14.19.1 - ~/.nvm/versions/node/v14.19.1/bin/node Yarn: 1.22.15 - /usr/local/bin/yarn npm: 6.14.16 - ~/.nvm/versions/node/v14.19.1/bin/npm Watchman: 2021.09.27.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0 IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7678000 Xcode: 13.0/13A233 - /usr/bin/xcodebuild npmPackages: expo: ^45.0.0 => 45.0.4 react: 17.0.2 => 17.0.2 react-native: 0.68.1 => 0.68.1 Expo Workflow: bare

Reproducible demo

Not sure what I should provide. This issue appeared after installing expo modules based on https://docs.expo.dev/bare/installing-expo-modules/#usage

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 57 (6 by maintainers)

Most upvoted comments

Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue.

The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.

A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.

Resources

Common concerns

“I’ve only been able to reproduce it in private, proprietary code”

You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this manual debugging guide to learn how to isolate the problem from the rest of your codebase.

“I didn’t have time to create one”

That’s understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template.

“You can reproduce it by yourself by creating a project and following these steps”

This is useful knowledge, but it’s still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue.

I guess this issue isn’t resolved, I’m getting the same error though.

I landed on this because of a similar issue. Here is how I made it work.

  • Xcode version 15.0.1 (15A507)
  • Expo SDK 49
  1. Wipe everything related to iOS and make sure there is no build artifacts cache.
npx react-native-clean-project
  1. Fix expected package versions
npx expo-doctor
npx expo install --fix
  1. Clean native dependencies
npx expo prebuild --clean
  1. Open Xcode, and hit the play button ▶️ (always use .xcworkspace with cocoapods)
open ios/YOURPORJECTNAME.xcworkspace

✅ Build Succeeded

Can confirm this issue is also seemingly present in the XCode 14.0 beta (M1 Pro)

image

I also am having this issue with an Expo SDK 44 project. I could compile with expo run:ios fine on an Intel Mac, but I was getting the No such module ‘ExpoModulesCore’ error when trying to compile on an M1 MacBook.

Tried all those steps you listed @byCedric, with no luck.

This workaround fixed it for me.

Oddly, I have a separate Expo SDK 44 project that compiles fine on the M1 MacBook without the workaround above 🤷🏻‍♂️

have the same issue on XCode 14 and m1 ;/

can the issue be reopened please …

Same issues

xcode 14.2 with m1 chip

-> none of these solution works for me

This block in my podfile from a stackoverflow post I can’t seem to find again seems to fix it for me on M1 Pro. (XCode 14.0). Your mileage my vary though

post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)

    # Fixing something

    installer.aggregate_targets.each do |aggregate_target| 
      aggregate_target.user_project.native_targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)'] # or it won't build on apple silicon
          # without explicitly clearing this out, it flaps between excluding arm64 or not
          config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "" # stop this setting from waffling between arm65/x86_64 machines after pod install
          # Fix some library / linker errors
          config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES' # only one at a time
          config.build_settings['VALID_ARCHS'] = 'arm64 x86_64' # you need both to work on both CPU archs / release etc
          config.build_settings['EXCLUDED_ARCHS'] = 'i386' # or you get directory not found linker errors
        end
      end
      aggregate_target.user_project.save
    end

    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|

        # We support a smaller range of deployment than some libraries, eliminate related noise
        # This also avoids a nasty Folly bug about an API not available until ios10+
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "12.0"
      end
    end

    # If you move versions around though you get another nasty Folly bug about redefined symbols, fix that...
    `sed -i -e  $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`


It needs to be added in the appropriate place in post_install hook, like here

post_install do |installer|
  installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
    target_installation_result.native_target.build_configurations.each do |config|
      # Fix building failures on M1
      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
    end
  end
end

Just to leave my two cents on how I fixed my error, which seems different from @dev-sda1 but was similar to @fondue-tech when I first came across this issue. I started running into this problem when using build variants in bare.

I fixed it by going to “Build phases” and making sure the path to ExpoModulesProvider.swift was correct and unique (and actually verifying on my file system the file path was correct).

MacBook Air M2 2022 macOS: 13.0.1 (22A400) Xcode: 14.1 (14B47b) (Universal) Expo: 48.0.4

After creating the project, expo install @rnmapbox/maps, i removed arm64 from Excluded Architectures in Xcode and expo run:ios succeeds! (@rnmapbox/maps is what I put in for my use. There is no direct relationship.)

If it helps anyone 😃

https://github.com/facebook/react-native/issues/32704#issuecomment-1174458011

A year ago, when upgrading to expo SDK 48, I had this exact issue and fixed it by applying this fix here

post_install do |installer|
// other steps
    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
  end

Now I’m upgrading from 48 to 50 and the issue return. Ended up removing that code from the podfile and it works. Hope this helps someone.

This issue, no such module 'ExpoModulesCore', popped up for me with Xcode v14.3.1, Expo SDK 49.0.6, and the expo-dev-client, when trying to build for the iOS simulator with $ expo run:ios -d. [Running expo prebuild and opening the workspace in Xcode and remove Excluded Architecture (somehow arm64 was selected) as shown here resolved the issue for me.

M1 Mac mini Xcode Version 14.3 (14E222b)

Works for me: Product-> Destination -> Destination Architectures -> Show Rosetta Destinations

Thanks @come25136, removing the arm64 from Excluded Architecture worked like a charm!

@tsapeta Corrected it, still getting the error:

error: no such module 'ExpoModulesCore'

I was able to fix for my use case, hope this would help anyone else in a similar situation:

I had three build schemes for different environments and build settings. This error was occurring in two of those schemes, but not in the third.

Since the two schemes shared similar settings with the third, I reset both of them using the third as template and applied the additional settings that existed on them. This fixed the error for my use case.

Some weird observations I have noticed trying to debug the issue:

  • This error is usually caused by changes to project.pbxproj
  • If you set project.pbxproj to it’s last state before you encountered this error (regardless of new pod packages), you wouldn’t get the error again
  • Not sure why this happens

Providing another update - managed to get a successful build after forcing Xcode to run under Rosetta on my M1 Machine. Note that when I did this, builds took significantly longer and certain features like the Simulator and running on Device seem a bit hit and miss (wouldn’t work first time, restarting xcode fixed it for now.

Goto your Applications folder, right click your Xcode install and select “Get Info”, then check “Open using Rosetta”. Close and open your .xcworkspace file as usual and builds should succeed normally.

image image

Adding expo-modules-autolinking to project’s dependencies is not recommended, it may cause even more dependency conflicts. This and expo-modules-core are intended to be delivered only by the expo package. Could you run yarn why expo-modules-autolinking to see what’s installing the old version?

If you want to force using a specific version, I’d suggest using yarn resolutions instead.

@pohsiu I was using the package expo-updates, so maybe you’re not using it. Also I realized yesterday that after installing other expo packages like expo-auth-session, expo-webbrowser, expo-random … the problem came back 😐 I’m gonna attempt to reproduce the issue in a small example app, honestly, I think this issue should be reopened.

I had this issue with M1 + Xcode 14.2, and after trying all solutions what worked for me was just building with Xcode directly instead of CLI.

Had the same issue as well, but running through Xcode directly didn’t help. Removing EXCLUDED_ARCHS from project.pbxproj did though, then just built it through Xcode as well. Weird stuff. Also this thread helped : https://github.com/facebook/react-native/issues/32704

did you guys find any solution for xcode 13.4.1

Also, I just realised that I have this code snippet in my podfile.

__apply_Xcode_12_5_M1_post_install_workaround(installer)

I have now shifted to xCode 13, I wonder If I still need this

Unfortunately commenting this snippet out didn’t change anything for me (Also on XCode 14 Beta). However I can 99% of the time get it to build on my physical device by opening the .xcworkspace file in xcode